pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39635?usp=email )
Change subject: default_lm_fsm: Trigger ASP restart by disconnecting the stream ...................................................................... default_lm_fsm: Trigger ASP restart by disconnecting the stream Previous behavior was to restart the ASP top-to-bottom in the stack, which doesn't play well with the disconnect_cb(). For instance, upon LM FSM timer callback, osmo_ss7_asp_restart() would call osmo_stream_cli_open() which in turn would call osmo_stream_close(). As a result, in that code path events were being sent to the LM FSM itself notifying the disconnection of the SCTP conn, which in turn would call osmo_ss7_asp_restart() again, and everything ended up in a weird state where it couldn't create sockets properly. The better approach is to, from LM FSM, trigger disconnection of the SCTP conn, which will in turn, through disconnect_cb(), send the SCTP disconnect notification up the stack, which should then trigger re-establishment of the SCTP conn in the SCTP client case. Change-Id: I21ebc3cd716a0bcc74da0a789032570f038e119d --- M src/xua_default_lm_fsm.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/35/39635/1 diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 7c27b19..fc01605 100644 --- a/src/xua_default_lm_fsm.c +++ b/src/xua_default_lm_fsm.c @@ -207,7 +207,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"); - restart_asp(fi); + ss7_asp_disconnect_stream(lmp->asp); break; case SS7_ASP_LM_T_WAIT_NOTIFY: if (lmp->asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_NO_NOTIFY) { @@ -226,7 +226,7 @@ as = find_first_as_in_asp(lmp->asp); if (!as) { LOGPFSML(fi, LOGL_ERROR, "Unable to find AS!\n"); - restart_asp(fi); + ss7_asp_disconnect_stream(lmp->asp); return 0; } /* Fill in settings from first AS (TODO: multiple AS support) */ @@ -237,11 +237,11 @@ case SS7_ASP_LM_T_WAIT_NOTIY_RKM: /* No AS has reported via NOTIFY even after dynamic RKM * configuration */ - restart_asp(fi); + ss7_asp_disconnect_stream(lmp->asp); break; case SS7_ASP_LM_T_WAIT_RK_REG_RESP: /* timeout of registration of routing key */ - restart_asp(fi); + ss7_asp_disconnect_stream(lmp->asp); break; } return 0; @@ -285,12 +285,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"); - restart_asp(fi); + ss7_asp_disconnect_stream(lmp->asp); } 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) - restart_asp(fi); + ss7_asp_disconnect_stream(lmp->asp); /* 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 */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39635?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I21ebc3cd716a0bcc74da0a789032570f038e119d Gerrit-Change-Number: 39635 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pes...@sysmocom.de>