aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2019-11-19 01:26:13 +0100
committerHarald Welte <laforge@osmocom.org>2019-11-19 01:28:23 +0100
commit737016a9542ae8086b4db745ece29bc2532a98e3 (patch)
tree31242a55efe1ecbf4a7a47085372a82bda5b403f
parent58de416ff0c645c6431d1dc6f5ff907cc7ef4fa7 (diff)
asp: Don't override ASP and SCTP role when re-entering asp node
The code to set the default role (SG) and default SCTP role (server) must only be executed when the ASP node is first created. Subsequent times entering the pre-existing ASP node should not overwrite those role settings [or any other configuration for that matter] Change-Id: I068996a5e0d870043b652fb69a3c300adc6fda7c Closes: OS#4271
-rw-r--r--src/osmo_ss7_vty.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 0a3cea4..08d8c43 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -574,13 +574,16 @@ DEFUN(cs7_asp, cs7_asp_cmd,
return CMD_WARNING;
}
- asp = osmo_ss7_asp_find_or_create(inst, name, remote_port, local_port, protocol);
+ asp = osmo_ss7_asp_find(inst, name, remote_port, local_port, protocol);
if (!asp) {
- vty_out(vty, "cannot create ASP '%s'%s", name, VTY_NEWLINE);
- return CMD_WARNING;
+ asp = osmo_ss7_asp_find_or_create(inst, name, remote_port, local_port, protocol);
+ if (!asp) {
+ vty_out(vty, "cannot create ASP '%s'%s", name, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ asp->cfg.is_server = true;
+ asp->cfg.role = OSMO_SS7_ASP_ROLE_SG;
}
- asp->cfg.is_server = true;
- asp->cfg.role = OSMO_SS7_ASP_ROLE_SG;
vty->node = L_CS7_ASP_NODE;
vty->index = asp;