osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27028 )
Change subject: vty: use osmo_ss7_vty_go_parent
......................................................................
vty: use osmo_ss7_vty_go_parent
Remove unnecessary bsc_nat_vty_go_parent function, and use
osmo_ss7_vty_go_parent instead. Without the latter, it segfaults while
attempting to parse a config segment like this:
cs7 instance 0
point-code 0.23.3
asp asp-clnt-OsmoBSCNAT-CN 2905 0 m3ua
remote-ip 127.0.0.1
local-ip 127.0.0.3
sccp-address msc # segfault here, vty->index == NULL
routing-indicator PC
point-code 0.23.1
Related: SYS#5560
Related:
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/26659/comment/c99b8cca_865449aa/
Change-Id: Iee6ece062f11694acb771463be7effb7342e92f2
---
M include/osmocom/bsc_nat/vty.h
M src/osmo-bsc-nat/main.c
M src/osmo-bsc-nat/vty.c
3 files changed, 1 insertion(+), 22 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/include/osmocom/bsc_nat/vty.h b/include/osmocom/bsc_nat/vty.h
index f882c23..9a842b5 100644
--- a/include/osmocom/bsc_nat/vty.h
+++ b/include/osmocom/bsc_nat/vty.h
@@ -28,4 +28,3 @@
};
void bsc_nat_vty_init(void);
-int bsc_nat_vty_go_parent(struct vty *vty);
diff --git a/src/osmo-bsc-nat/main.c b/src/osmo-bsc-nat/main.c
index 715ade0..7e9696e 100644
--- a/src/osmo-bsc-nat/main.c
+++ b/src/osmo-bsc-nat/main.c
@@ -49,7 +49,7 @@
static struct vty_app_info vty_info = {
.name = "OsmoBSCNAT",
.version = PACKAGE_VERSION,
- .go_parent_cb = bsc_nat_vty_go_parent,
+ .go_parent_cb = osmo_ss7_vty_go_parent,
};
static struct {
diff --git a/src/osmo-bsc-nat/vty.c b/src/osmo-bsc-nat/vty.c
index 128940e..41681d4 100644
--- a/src/osmo-bsc-nat/vty.c
+++ b/src/osmo-bsc-nat/vty.c
@@ -28,26 +28,6 @@
#include <osmocom/bsc_nat/bsc_nat.h>
#include <osmocom/bsc_nat/vty.h>
-int bsc_nat_vty_go_parent(struct vty *vty)
-{
- switch (vty->node) {
- case BSC_NAT_NODE:
- vty->node = CONFIG_NODE;
- vty->index = g_bsc_nat;
- break;
- case CONFIG_NODE:
- vty->node = ENABLE_NODE;
- vty->index = NULL;
- break;
- default:
- vty->node = CONFIG_NODE;
- vty->index = NULL;
- break;
- }
-
- return vty->node;
-}
-
static struct cmd_node bsc_nat_node = {
BSC_NAT_NODE,
"%s(config-bsc-nat)# ",
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27028
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: Iee6ece062f11694acb771463be7effb7342e92f2
Gerrit-Change-Number: 27028
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged