pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42567?usp=email )
Change subject: xua_rkm: send_reg_req: Avoid adding Routing Context with value 0
......................................................................
xua_rkm: send_reg_req: Avoid adding Routing Context with value 0
We use routing context 0 internally as "no routing context". Since the
Routing Context in the Routing KEy IE in RKM REG REQ is optional, if
local rctx is 0 (because we expect to get one allocated by the STP and
receive it through RKM REG RESP), avoid sending it with the value 0.
Change-Id: Iaa584fea3020af06951aea16e638ac6e6a84ae21
---
M src/xua_rkm.c
1 file changed, 7 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 2e7c227..16b494b 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -120,13 +120,18 @@
{
struct msgb *msg = m3ua_msgb_alloc(__func__);
int tmod = osmo_ss7_tmode_to_xua(traf_mode);
+ uint16_t outter_len;
/* One individual Registration Request according to Chapter 3.6.1 */
msgb_put_u16(msg, M3UA_IEI_ROUT_KEY); /* outer IEI */
- msgb_put_u16(msg, 32 + 4); /* outer length */
+ outter_len = 24 + 4;
+ if (rkey->context > 0)
+ outter_len += 8;
+ msgb_put_u16(msg, outter_len); /* outer length */
/* nested IEIs */
msgb_t16l16vp_put_u32(msg, M3UA_IEI_LOC_RKEY_ID, rkey->l_rk_id);
- msgb_t16l16vp_put_u32(msg, M3UA_IEI_ROUTE_CTX, rkey->context);
+ if (rkey->context > 0)
+ msgb_t16l16vp_put_u32(msg, M3UA_IEI_ROUTE_CTX, rkey->context);
msgb_t16l16vp_put_u32(msg, M3UA_IEI_TRAF_MODE_TYP, tmod);
msgb_t16l16vp_put_u32(msg, M3UA_IEI_DEST_PC, rkey->pc);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42567?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: Iaa584fea3020af06951aea16e638ac6e6a84ae21
Gerrit-Change-Number: 42567
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42570?usp=email )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Use osmo_ss7_asp_active() in several places
......................................................................
Use osmo_ss7_asp_active() in several places
Change-Id: I172e691cb61ac68e2410b44e124737f7a4dd2775
---
M src/m3ua.c
M src/sua.c
M src/xua_as_fsm.c
M src/xua_rkm.c
4 files changed, 4 insertions(+), 4 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/src/m3ua.c b/src/m3ua.c
index a22a64a..243f5b9 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -1166,7 +1166,7 @@
int rc;
/* SNM only permitted in ACTIVE state */
- if (asp->fi->state != XUA_ASP_S_ACTIVE) {
+ if (!osmo_ss7_asp_active(asp)) {
if (asp->fi->state == XUA_ASP_S_INACTIVE &&
asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_SNM_INACTIVE) {
LOGPASP(asp, DLM3UA, LOGL_NOTICE, "quirk snm_inactive active: "
diff --git a/src/sua.c b/src/sua.c
index 9ebe4c6..b169d50 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -1113,7 +1113,7 @@
static int sua_rx_snm(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
/* SNM only permitted in ACTIVE state */
- if (asp->fi->state != XUA_ASP_S_ACTIVE) {
+ if (!osmo_ss7_asp_active(asp)) {
if (asp->fi->state == XUA_ASP_S_INACTIVE && asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_SNM_INACTIVE) {
LOGPASP(asp, DLSUA, LOGL_NOTICE, "quirk snm_inactive active: "
"Accepting SSNM in state %s\n", osmo_fsm_inst_state_name(asp->fi));
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index 568834e..0ba1b2a 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -296,7 +296,7 @@
if (asp_cmp == asp)
continue;
- if (asp->fi && asp->fi->state == XUA_ASP_S_ACTIVE)
+ if (osmo_ss7_asp_active(asp))
return true;
}
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 16b494b..92fbdac 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -420,7 +420,7 @@
}
/* Reject if ASP is still active */
- if (asp->fi->state == XUA_ASP_S_ACTIVE) {
+ if (osmo_ss7_asp_active(asp)) {
msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_ASP_ACTIVE, 0);
return -1;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42570?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: I172e691cb61ac68e2410b44e124737f7a4dd2775
Gerrit-Change-Number: 42570
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42563?usp=email )
Change subject: xua_lm: Use XLM SAP to send M-SCTP_RELEASE.req
......................................................................
xua_lm: Use XLM SAP to send M-SCTP_RELEASE.req
Change-Id: I582855acaced48fb838700a3013f94bee7db75ad
---
M src/xua_default_lm_fsm.c
M src/xua_lm_sap.c
2 files changed, 9 insertions(+), 5 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c
index 3e36daf..a7e8d9c 100644
--- a/src/xua_default_lm_fsm.c
+++ b/src/xua_default_lm_fsm.c
@@ -278,12 +278,12 @@
oxp = data;
if (oxp->u.rk_reg.status != M3UA_RKM_REG_SUCCESS) {
LOGPFSML(fi, LOGL_NOTICE, "Received RKM_REG_RSP with negative result\n");
- ss7_asp_disconnect_stream(lmp->asp);
+ xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_SCTP_RELEASE, PRIM_OP_REQUEST);
} else {
unsigned long timeout_sec;
rc = handle_reg_conf(fi, oxp->u.rk_reg.key.l_rk_id, oxp->u.rk_reg.key.context);
if (rc < 0)
- ss7_asp_disconnect_stream(lmp->asp);
+ xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_SCTP_RELEASE, PRIM_OP_REQUEST);
/* RKM registration was successful, we can transition to WAIT_NOTIFY
* state and assume that an NOTIFY/AS-INACTIVE arrives within
* T_WAIT_NOTIFY_RKM seconds */
@@ -337,7 +337,7 @@
/* we have been waiting for the ASP to come up, but it
* failed to do so */
LOGPFSML(fi, LOGL_NOTICE, "Peer didn't send any ASP_UP in time! Restarting ASP\n");
- ss7_asp_disconnect_stream(lmp->asp);
+ xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_SCTP_RELEASE, PRIM_OP_REQUEST);
break;
case SS7_ASP_LM_T_WAIT_NOTIFY:
if (lmp->asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_NO_NOTIFY) {
@@ -356,11 +356,11 @@
case SS7_ASP_LM_T_WAIT_NOTIY_RKM:
/* No AS has reported via NOTIFY even after dynamic RKM
* configuration */
- ss7_asp_disconnect_stream(lmp->asp);
+ xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_SCTP_RELEASE, PRIM_OP_REQUEST);
break;
case SS7_ASP_LM_T_WAIT_RK_REG_RESP:
/* timeout of registration of routing key */
- ss7_asp_disconnect_stream(lmp->asp);
+ xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_SCTP_RELEASE, PRIM_OP_REQUEST);
break;
}
return 0;
diff --git a/src/xua_lm_sap.c b/src/xua_lm_sap.c
index 8e89afb..60bb48a 100644
--- a/src/xua_lm_sap.c
+++ b/src/xua_lm_sap.c
@@ -143,6 +143,10 @@
osmo_xlm_prim_name(&prim->oph));
switch (OSMO_PRIM_HDR(&prim->oph)) {
+ case OSMO_PRIM(OSMO_XLM_PRIM_M_SCTP_RELEASE, PRIM_OP_REQUEST):
+ /* Layer Manager asks us to release an SCTP association with the peer */
+ ss7_asp_disconnect_stream(asp);
+ break;
case OSMO_PRIM(OSMO_XLM_PRIM_M_ASP_UP, PRIM_OP_REQUEST):
/* Layer Manager asks us to send an ASPUP REQ */
osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_M_ASP_UP_REQ, NULL);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42563?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: I582855acaced48fb838700a3013f94bee7db75ad
Gerrit-Change-Number: 42563
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42565?usp=email )
Change subject: xua_lm: Fix ending up from active to idle forever
......................................................................
xua_lm: Fix ending up from active to idle forever
Previous transition to S_IDLE was wrong, since there's no way to recover
from that state unless the SCTP connection is closed.
Instead, try harder waiting for some new notifications to try
re-activating the ASP and see if the AS becomes active, or end up timing
out and reconnecting to re-attempt complete set of steps.
Change-Id: I5c97c0ede9c27c63f9259b43b7267a3d5d71681d
---
M src/xua_default_lm_fsm.c
1 file changed, 8 insertions(+), 3 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c
index a7e8d9c..6f25e17 100644
--- a/src/xua_default_lm_fsm.c
+++ b/src/xua_default_lm_fsm.c
@@ -310,11 +310,15 @@
break;
case LM_E_NOTIFY_IND:
oxp = data;
+ ENSURE_ASP_OR_IPSP(fi, event);
OSMO_ASSERT(oxp->oph.primitive == OSMO_XLM_PRIM_M_NOTIFY);
OSMO_ASSERT(oxp->oph.operation == PRIM_OP_INDICATION);
if (oxp->u.notify.status_type == M3UA_NOTIFY_T_STATCHG &&
- oxp->u.notify.status_info != M3UA_NOTIFY_I_AS_ACT)
- lm_fsm_state_chg(fi, S_IDLE);
+ oxp->u.notify.status_info != M3UA_NOTIFY_I_AS_ACT) {
+ /* There not much we can do here, Go back to S_WAIT_NOTIFY to either wait for
+ * some notification to re-attempt, or end up timing out and reconnecting.*/
+ lm_fsm_state_chg(fi, S_WAIT_NOTIFY);
+ }
break;
}
}
@@ -404,7 +408,8 @@
.in_event_mask = S(LM_E_ASP_ACT_IND) |
S(LM_E_AS_INACTIVE_IND) |
S(LM_E_NOTIFY_IND),
- .out_state_mask = S(S_IDLE),
+ .out_state_mask = S(S_IDLE) |
+ S(S_WAIT_NOTIFY),
.name = "ACTIVE",
.action = lm_active,
},
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42565?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: I5c97c0ede9c27c63f9259b43b7267a3d5d71681d
Gerrit-Change-Number: 42565
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>