pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39619?usp=email )
Change subject: stp: Fix expectancies of TC_clnt_quirk_snm_inactive
......................................................................
stp: Fix expectancies of TC_clnt_quirk_snm_inactive
The test STP_Tests_M3UA.TC_clnt_quirk_snm_inactive validates the
snm_inactive quirk by sending a DAUD before the link being activated,
and expecting a DAVA to make sure osmo-stp did indeed process the SNM
message.
However, osmo-stp used to lack proper route validation based on link
state, which means it would incorrectly assumed the link for the
affected PC (55) in the test was active and hence would answer with a
DAVA. After libosmo-sigtran.git Change-Id
I928fb1ef5db6922f1386a188e3fbf9e70780f25d this wrong behavior is fixed,
and hence osmo-stp starts answering with a DUNA instead of a DAVA, since
AS "as-client" has not yet been activated during the test.
Fix the test expectancies by expecting a DUNA instead of a DAVA.
Change-Id: I907981c1487b299df852c405bae1fefff4bf5191
Depends: libosmo-sigtran.git Change-Id I928fb1ef5db6922f1386a188e3fbf9e70780f25d
Related: SYS#7112
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
osmith: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index c3598d3..3fb3fc0 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -1325,7 +1325,7 @@
var template (value) M3UA_Point_Codes aff_pcs := { ts_M3UA_PC(f_m3ua_srv_config(0).point_code) };
f_M3UA_send(M3UA_SRV(0), ts_M3UA_DAUD(aff_pcs));
- f_M3UA_exp(M3UA_SRV(0), tr_M3UA_DAVA(aff_pcs));
+ f_M3UA_exp(M3UA_SRV(0), tr_M3UA_DUNA(aff_pcs));
setverdict(pass);
f_no_quirk("no_notify");
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39619?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I907981c1487b299df852c405bae1fefff4bf5191
Gerrit-Change-Number: 39619
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
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>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39637?usp=email )
Change subject: Use default_layer_manager for all ASPs in SCTP-mode=client & m3ua-mode=ASP
......................................................................
Use default_layer_manager for all ASPs in SCTP-mode=client & m3ua-mode=ASP
With previous behavior, only first ASP configured as SCTPmode=client and
m3ua-mode=ASP in osmo_sccp_simple_client_on_ss7_id() would be applied
the default_layer_manager.
AS a result, if a client app (eg. osmo-bsc) would manually configure 1 AS
with 2 ASPs (and leave it to dynamic RKM to setup everything at osmo-stp),
it would fail, since the default LM FSM (in charge of waiting for NTFY and
then sending REQ_REG) would only be
applied to the first ASP.
So one would see 1st ASP doing ASPUP+REG_REQ+ASPAC correctly, but the
second one would do ASPUP+ASPAC directly, which would be refused by
osmo-stp since it had no routing context configured for that ASP/AS.
Change-Id: I50f9a088c55ad103cc23758192773fc855747e12
---
M src/osmo_ss7_asp.c
M src/osmo_ss7_vty.c
M src/sccp_user.c
M src/ss7_asp.h
M src/xua_default_lm_fsm.c
5 files changed, 37 insertions(+), 12 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index 503b31c..b766071 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -1291,3 +1291,22 @@
}
return -1;
}
+
+/* Apply sane configs for unconfigured options and restart the ASP. */
+void ss7_asp_restart_after_reconfigure(struct osmo_ss7_asp *asp)
+{
+ /* Make sure proper defaults values are applied if user didn't provide
+ * specific default values */
+ ss7_asp_set_default_peer_hosts(asp);
+
+ /* Apply default LM FSM for client ASP */
+ if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA &&
+ asp->cfg.role == OSMO_SS7_ASP_ROLE_ASP &&
+ !asp->cfg.is_server) {
+ osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG);
+ } else {
+ osmo_ss7_asp_remove_default_lm(asp);
+ }
+
+ osmo_ss7_asp_restart(asp);
+}
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 576ad7c..8365db2 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -3001,9 +3001,7 @@
switch (vty->node) {
case L_CS7_ASP_NODE:
asp = vty->index;
- /* Make sure proper defaults values are set */
- ss7_asp_set_default_peer_hosts(asp);
- osmo_ss7_asp_restart(asp);
+ ss7_asp_restart_after_reconfigure(asp);
vty->node = L_CS7_NODE;
vty->index = asp->inst;
break;
diff --git a/src/sccp_user.c b/src/sccp_user.c
index d27d4bb..b5b6b4b 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -628,6 +628,7 @@
asp = asp_i;
LOGP(DLSCCP, LOGL_NOTICE, "%s: ASP %s for %s is not associated with any AS, using it\n",
name, asp->cfg.name, osmo_ss7_asp_protocol_name(prot));
+ osmo_ss7_as_add_asp(as, asp->cfg.name);
break;
}
if (!asp) {
@@ -642,6 +643,7 @@
if (!asp)
goto out_rt;
asp_created = true;
+ asp->simple_client_allocated = true;
/* Ensure that the ASP we use is set to operate as a client. */
asp->cfg.is_server = false;
/* Ensure that the ASP we use is set to role ASP. */
@@ -650,12 +652,10 @@
ss7_asp_peer_set_hosts(&asp->cfg.local, asp, &default_local_ip, 1);
if (default_remote_ip)
ss7_asp_peer_set_hosts(&asp->cfg.remote, asp, &default_remote_ip, 1);
- /* Make sure proper defaults are applied if app didn't provide specific default values */
- ss7_asp_set_default_peer_hosts(asp);
- asp->simple_client_allocated = true;
+ /* Make sure proper defaults are applied if app didn't
+ provide specific default values, then restart the ASP: */
+ ss7_asp_restart_after_reconfigure(asp);
}
-
- osmo_ss7_as_add_asp(as, asp->cfg.name);
}
/* Extra sanity checks if the ASP asp-clnt-* was pre-configured over VTY: */
@@ -696,12 +696,9 @@
goto out_asp;
}
}
+ /* ASP was already started here previously by VTY go_parent. */
}
- /* Restart ASP */
- if (prot != OSMO_SS7_ASP_PROT_IPA)
- osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG);
- osmo_ss7_asp_restart(asp);
LOGP(DLSCCP, LOGL_NOTICE, "%s: Using ASP instance %s\n", name,
asp->cfg.name);
diff --git a/src/ss7_asp.h b/src/ss7_asp.h
index 377274a..a05d870 100644
--- a/src/ss7_asp.h
+++ b/src/ss7_asp.h
@@ -110,5 +110,8 @@
int ss7_asp_apply_new_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx);
int ss7_asp_apply_drop_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx);
+void ss7_asp_restart_after_reconfigure(struct osmo_ss7_asp *asp);
+void osmo_ss7_asp_remove_default_lm(struct osmo_ss7_asp *asp);
+
#define LOGPASP(asp, subsys, level, fmt, args ...) \
_LOGSS7((asp)->inst, subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c
index fc01605..0952c9e 100644
--- a/src/xua_default_lm_fsm.c
+++ b/src/xua_default_lm_fsm.c
@@ -413,6 +413,14 @@
.prim_cb = default_lm_prim_cb,
};
+void osmo_ss7_asp_remove_default_lm(struct osmo_ss7_asp *asp)
+{
+ if (!asp->lm_priv)
+ return;
+ osmo_fsm_inst_term(asp->lm_priv, OSMO_FSM_TERM_ERROR, NULL);
+ asp->lm_priv = NULL;
+}
+
int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level)
{
struct lm_fsm_priv *lmp;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39637?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I50f9a088c55ad103cc23758192773fc855747e12
Gerrit-Change-Number: 39637
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
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>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39639?usp=email )
Change subject: xua_rkm: Make sure existing AS gets added in list to receive ASP-INACTIVE.ind event
......................................................................
xua_rkm: Make sure existing AS gets added in list to receive ASP-INACTIVE.ind event
Eg. if a 2nd ASP tries to register against a given AS (RFC 4666 5.1.3),
it should still update the AS to tell it the ASP is in ASP-INACTIVE
state. This way depending on traffic mode, the AS state may change as
well.
Change-Id: I85948ab98623a8a53521eb2d2e84244011b39a93
---
M src/xua_rkm.c
1 file changed, 18 insertions(+), 11 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index dd07db2..f616a3a 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -221,6 +221,14 @@
as = osmo_ss7_as_find_by_rctx(asp->inst, rctx);
if (as) {
LOGPASP(asp, DLSS7, LOGL_NOTICE, "RKM: Found existing AS for RCTX %u\n", rctx);
+ /* Early return before allocating stuff if no space left: */
+ if (*nas_idx >= max_nas_idx) {
+ LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: not enough room for newly assigned AS (max %u AS)\n",
+ max_nas_idx+1);
+ msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_INSUFF_RESRC, 0);
+ return -1;
+ }
+
if (as->cfg.routing_key.pc != dpc) {
LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: DPC doesn't match, rejecting AS (%u != %u)\n",
as->cfg.routing_key.pc, dpc);
@@ -244,6 +252,14 @@
as->cfg.mode_set_by_peer = true;
}
} else if (asp->inst->cfg.permit_dyn_rkm_alloc) {
+ /* Early return before allocating stuff if no space left: */
+ if (*nas_idx >= max_nas_idx) {
+ LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: not enough room for newly assigned AS (max %u AS)\n",
+ max_nas_idx+1);
+ msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_INSUFF_RESRC, 0);
+ return -1;
+ }
+
/* Create an AS for this routing key */
snprintf(namebuf, sizeof(namebuf), "as-rkm-%u", rctx);
as = osmo_ss7_as_find_or_create(asp->inst, namebuf, OSMO_SS7_ASP_PROT_M3UA);
@@ -272,17 +288,6 @@
msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_CANT_SUPP_UNQ_RT, 0);
return -1;
}
-
- /* append to list of newly assigned as */
- if (*nas_idx >= max_nas_idx) {
- ss7_route_destroy(rt);
- osmo_ss7_as_destroy(as);
- LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: not enough room for newly assigned AS (max %u AS)\n",
- max_nas_idx+1);
- msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_INSUFF_RESRC, 0);
- return -1;
- }
- newly_assigned_as[(*nas_idx)++] = as;
} else {
/* not permitted to create dynamic RKM entries */
LOGPASP(asp, DLSS7, LOGL_NOTICE, "RKM: RCTX %u not found in configuration, and "
@@ -294,6 +299,8 @@
/* Success: Add just-create AS to connected ASP + report success */
osmo_ss7_as_add_asp(as, asp->cfg.name);
msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_SUCCESS, rctx);
+ /* append to list of newly assigned as */
+ newly_assigned_as[(*nas_idx)++] = as;
return 0;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39639?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I85948ab98623a8a53521eb2d2e84244011b39a93
Gerrit-Change-Number: 39639
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria.
pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/39663?usp=email )
Change subject: sctp_{server,proxy}: log SCTP TSN, SID, SSN, and data len
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/39663?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I3692e3bfccdb2ab0a705b1f0903181197c0a2237
Gerrit-Change-Number: 39663
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 03 Mar 2025 20:04:21 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes