Change in libosmo-sccp[master]: ss7: Only override traffic mode from recv REG REQ if not set by VTY

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
Mon Oct 28 19:16:53 UTC 2019


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

Change subject: ss7: Only override traffic mode from recv REG REQ if not set by VTY
......................................................................

ss7: Only override traffic mode from recv REG REQ if not set by VTY

RFC 4666 (SS7/MTP3/M3UA) states in isection 4.3.4.3 ASP Active Procedures:
"""
If the traffic handling mode of the Application Server is not already known via
configuration data, then the traffic handling mode indicated in the
first ASP Active message causing the transition of the Application
Server state to AS-ACTIVE MAY be used to set the mode.
"""

In section 3.6.1 Registration Request (REG REQ), no related information
is provided on how to handle it, but still makes sense to apply same
behavior as in 4.3.4.3.

Related: OS#4220
Change-Id: Iaebe3a93ad8d2d84ae01e41b02674f8ece9dfc95
---
M TODO-RELEASE
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7.c
M src/osmo_ss7_vty.c
M src/xua_rkm.c
5 files changed, 10 insertions(+), 6 deletions(-)

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



diff --git a/TODO-RELEASE b/TODO-RELEASE
index 224f6bc..37a636e 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -9,3 +9,4 @@
 #library	what		description / commit summary line
 libosmo-sigtran osmo_ss7_asp_peer	ABI breakage (host is now an array of strings)
 libosmo-sigtran osmo_ss7_as		ABI breakage (added field last_asp_idx_sent)
+libosmo-sigtran osmo_ss7_as		ABI breakage (added field mode_set_by_vty)
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 4f3d6f5..1b5fc31 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -314,6 +314,7 @@
 		enum osmo_ss7_asp_protocol proto;
 		struct osmo_ss7_routing_key routing_key;
 		enum osmo_ss7_as_traffic_mode mode;
+		bool mode_set_by_vty;
 		uint32_t recovery_timeout_msec;
 		uint8_t qos_class;
 		struct {
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 6c6e412..efbceb8 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -2049,12 +2049,13 @@
 {
 	switch (in) {
 	case M3UA_TMOD_OVERRIDE:
-	default:
 		return OSMO_SS7_AS_TMOD_OVERRIDE;
 	case M3UA_TMOD_LOADSHARE:
 		return OSMO_SS7_AS_TMOD_LOADSHARE;
 	case M3UA_TMOD_BCAST:
 		return OSMO_SS7_AS_TMOD_BCAST;
+	default:
+		OSMO_ASSERT(false);
 	}
 }
 
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index b068fec..9c22fb1 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -811,6 +811,7 @@
 	struct osmo_ss7_as *as = vty->index;
 
 	as->cfg.mode = get_string_value(osmo_ss7_as_traffic_mode_vals, argv[0]);
+	as->cfg.mode_set_by_vty = true;
 	return CMD_SUCCESS;
 }
 
@@ -994,7 +995,7 @@
 			continue;
 		vty_out(vty, "  asp %s%s", asp->cfg.name, VTY_NEWLINE);
 	}
-	if (as->cfg.mode != OSMO_SS7_AS_TMOD_OVERRIDE)
+	if (as->cfg.mode_set_by_vty)
 		vty_out(vty, "  traffic-mode %s%s",
 			osmo_ss7_as_traffic_mode_name(as->cfg.mode), VTY_NEWLINE);
 	if (as->cfg.recovery_timeout_msec != 2000) {
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 2d8a25e..b3c785f 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -152,7 +152,6 @@
 			   unsigned int max_nas_idx, unsigned int *nas_idx)
 {
 	uint32_t rk_id, rctx, _tmode, dpc;
-	enum osmo_ss7_as_traffic_mode tmode;
 	struct osmo_ss7_as *as;
 	struct osmo_ss7_route *rt;
 	char namebuf[32];
@@ -171,8 +170,6 @@
 		return -1;
 	}
 
-	tmode = osmo_ss7_tmode_from_xua(_tmode);
-
 	/* destination point code (mandatory) */
 	dpc = xua_msg_get_u32(inner, M3UA_IEI_DEST_PC);
 
@@ -220,6 +217,8 @@
 			msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_INVAL_RKEY, 0);
 			return -1;
 		}
+		if (!as->cfg.mode_set_by_vty && _tmode)
+			as->cfg.mode = osmo_ss7_tmode_from_xua(_tmode);
 	} else if (asp->inst->cfg.permit_dyn_rkm_alloc) {
 		/* Create an AS for this routing key */
 		snprintf(namebuf, sizeof(namebuf), "as-rkm-%u", rctx);
@@ -232,7 +231,8 @@
 
 		as->cfg.description = talloc_strdup(as, "Auto-generated by RKM");
 		as->rkm_dyn_allocated = true;
-		as->cfg.mode = tmode;
+		if (!as->cfg.mode_set_by_vty && _tmode)
+			as->cfg.mode = osmo_ss7_tmode_from_xua(_tmode);
 		/* fill routing key */
 		as->cfg.routing_key.pc = dpc;
 		as->cfg.routing_key.context = rctx;

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Iaebe3a93ad8d2d84ae01e41b02674f8ece9dfc95
Gerrit-Change-Number: 15804
Gerrit-PatchSet: 6
Gerrit-Owner: pespin <pespin at sysmocom.de>
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/20191028/bc147490/attachment.htm>


More information about the gerrit-log mailing list