pespin submitted this change.
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(-)
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) {
To view, visit change 40194. To unsubscribe, or for help writing mail filters, visit settings.