pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40194?usp=email )
Change subject: asp: Make sure previous stream_srv is immediatelly destroyed when requested ......................................................................
asp: Make sure previous stream_srv is immediatelly destroyed when requested
This will be needed when the asp is in SCTP=server mode and we request it to shutdown/restart.
Path in xua_accept_cb() for dynamic ASPs in SCTP=server mode needs to be fixed since it was wrongly calling osmo_ss7_asp_restart() and taking advantage of the fact that the asp->server was not being freed in that case.
Change-Id: I8edd64234654ba987f35de2d7ad610e96bda27eb --- M src/osmo_ss7_asp.c M src/osmo_ss7_xua_srv.c 2 files changed, 12 insertions(+), 1 deletion(-)
Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index 4044003..02dbcb8 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -699,6 +699,12 @@ asp->client = NULL; osmo_stream_cli_destroy(cli); } + if (asp->server) { + /* Make sure we close the previous stream right now: */ + srv = asp->server; + asp->server = NULL; + osmo_stream_srv_destroy(srv); + } } else { /* We are in client mode now */ if (asp->server) { diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c index 52a3508..5483aae 100644 --- a/src/osmo_ss7_xua_srv.c +++ b/src/osmo_ss7_xua_srv.c @@ -153,7 +153,12 @@ oxs->cfg.local.host_cnt); ss7_asp_peer_set_hosts(&asp->cfg.remote, asp, &hostbuf_ptr, 1); - osmo_ss7_asp_restart(asp); + if ((rc = xua_asp_fsm_start(asp, asp->cfg.role, LOGL_DEBUG)) < 0) { + talloc_free(sock_name); + osmo_ss7_asp_destroy(asp); + return rc; + } + OSMO_ASSERT(asp->fi); } } if (!asp) {