[MERGED] osmocom-bb[master]: mobile/vty_interface.c: do not install default commands

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Mon Oct 23 03:02:14 UTC 2017


Vadim Yanitskiy has submitted this change and it was merged.

Change subject: mobile/vty_interface.c: do not install default commands
......................................................................


mobile/vty_interface.c: do not install default commands

Since in recent version of libosmocore default commands (such as
'exit' and 'end') are being installed by default, no need to
install them twice. This will crash the program.

Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 0 insertions(+), 50 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index b26d471..9a889e9 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -2777,50 +2777,6 @@
 	return vty->node;
 }
 
-/* Down vty node level. */
-gDEFUN(ournode_exit,
-       ournode_exit_cmd, "exit", "Exit current mode and down to previous mode\n")
-{
-	switch (vty->node) {
-	case MS_NODE:
-		vty->node = CONFIG_NODE;
-		vty->index = NULL;
-		break;
-	case TESTSIM_NODE:
-	case SUPPORT_NODE:
-		vty->node = MS_NODE;
-		break;
-	default:
-		break;
-	}
-	return CMD_SUCCESS;
-}
-
-/* End of configuration. */
-gDEFUN(ournode_end,
-       ournode_end_cmd, "end", "End current mode and change to enable mode.")
-{
-	switch (vty->node) {
-	case VIEW_NODE:
-	case ENABLE_NODE:
-		/* Nothing to do. */
-		break;
-	case CONFIG_NODE:
-	case VTY_NODE:
-	case MS_NODE:
-	case TESTSIM_NODE:
-	case SUPPORT_NODE:
-		vty_config_unlock(vty);
-		vty->node = ENABLE_NODE;
-		vty->index = NULL;
-		vty->index_sub = NULL;
-		break;
-	default:
-		break;
-	}
-	return CMD_SUCCESS;
-}
-
 DEFUN(off, off_cmd, "off",
 	"Turn mobiles off (shutdown) and exit")
 {
@@ -2886,8 +2842,6 @@
 	install_element(CONFIG_NODE, &cfg_no_ms_cmd);
 	install_node(&ms_node, config_write);
 	install_default(MS_NODE);
-	install_element(MS_NODE, &ournode_exit_cmd);
-	install_element(MS_NODE, &ournode_end_cmd);
 	install_element(MS_NODE, &cfg_ms_show_this_cmd);
 	install_element(MS_NODE, &cfg_ms_layer2_cmd);
 	install_element(MS_NODE, &cfg_ms_sap_cmd);
@@ -2931,8 +2885,6 @@
 	install_element(MS_NODE, &cfg_ms_support_cmd);
 	install_node(&support_node, config_write_dummy);
 	install_default(SUPPORT_NODE);
-	install_element(SUPPORT_NODE, &ournode_exit_cmd);
-	install_element(SUPPORT_NODE, &ournode_end_cmd);
 	install_element(SUPPORT_NODE, &cfg_ms_sup_dtmf_cmd);
 	install_element(SUPPORT_NODE, &cfg_ms_sup_no_dtmf_cmd);
 	install_element(SUPPORT_NODE, &cfg_ms_sup_sms_cmd);
@@ -2989,8 +2941,6 @@
 	install_element(SUPPORT_NODE, &cfg_ms_sup_no_skip_max_per_band_cmd);
 	install_node(&testsim_node, config_write_dummy);
 	install_default(TESTSIM_NODE);
-	install_element(TESTSIM_NODE, &ournode_exit_cmd);
-	install_element(TESTSIM_NODE, &ournode_end_cmd);
 	install_element(TESTSIM_NODE, &cfg_test_imsi_cmd);
 	install_element(TESTSIM_NODE, &cfg_test_ki_xor_cmd);
 	install_element(TESTSIM_NODE, &cfg_test_ki_comp128_cmd);

-- 
To view, visit https://gerrit.osmocom.org/4373
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>


More information about the gerrit-log mailing list