Change in libosmo-sccp[master]: asp: Don't override ASP and SCTP role when re-entering asp node

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Nov 19 00:37:14 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/16100 )

Change subject: asp: Don't override ASP and SCTP role when re-entering asp node
......................................................................

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
---
M src/osmo_ss7_vty.c
1 file changed, 8 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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 @@
 		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;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/16100
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I068996a5e0d870043b652fb69a3c300adc6fda7c
Gerrit-Change-Number: 16100
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191119/69b48a0b/attachment.htm>


More information about the gerrit-log mailing list