pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/40214?usp=email )


Change subject: asp: Avoid accessing dyn sctp-server ASP after closing conn 
during restart
......................................................................

asp: Avoid accessing dyn sctp-server ASP after closing conn during restart

This happens for instance if a dynamic ASP is shut down through VTY.

Change-Id: Ic9f2b01ddcf38d93396701cf5d406d1cfd18704d
---
M src/osmo_ss7_asp.c
1 file changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran 
refs/changes/14/40214/1

diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index 56767e9..1c303b6 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -735,6 +735,7 @@
 {
        int rc;
        char bufloc[512], bufrem[512];
+       bool destroyed = asp->dyn_allocated && asp->cfg.is_server;

        OSMO_ASSERT(ss7_initialized);
        ss7_asp_peer_snprintf(bufloc, sizeof(bufloc), &asp->cfg.local);
@@ -745,6 +746,10 @@
        /* First tear down previous state if existing: */
        ss7_asp_disconnect_stream(asp);

+       /* Dynamic ASPs in SCTP=server are destroyed when connection is closed. 
*/
+       if (destroyed)
+               return 0;
+
        /* The ASP FSM must be terminated *after* tearing down the conn, so that
         * DISCONNECT events go up the stack */
        if (asp->fi) {

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40214?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: Ic9f2b01ddcf38d93396701cf5d406d1cfd18704d
Gerrit-Change-Number: 40214
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>

Reply via email to