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