]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Actuall free the link
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 5 Jul 2018 02:27:52 +0000 (22:27 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 5 Jul 2018 02:27:52 +0000 (22:27 -0400)
src/modules/rlm_sigtran/event.c
src/modules/rlm_sigtran/libosmo-m3ua/sctp_m3ua_client.c

index c754ae2b9f8fa4a9337ac4e29d0f05f9dbd40f94..ba744e7bd0c9afd9f4805b531cae165bd8ead945 100644 (file)
@@ -132,6 +132,14 @@ static int _mtp3_link_free(struct mtp_link *mtp3_link)
        return 0;
 }
 
+static int _conn_free(sigtran_conn_t *conn)
+{
+       talloc_free(conn->mtp3_link);
+       talloc_free(conn->mtp3_link_set);
+
+       return 0;
+}
+
 /** Add a route to an m3ua_association
  *
  */
@@ -195,7 +203,8 @@ static int event_link_up(TALLOC_CTX *ctx, sigtran_conn_t **out, sigtran_conn_con
 
        conn = talloc_zero(ctx, sigtran_conn_t);
        conn->conf = conf;
-       conn->bsc_data = bsc_data_alloc(ctx);
+       conn->bsc_data = bsc_data_alloc(conn;
+       talloc_set_destructor(conn, _conn_free);
 
        /*
         *      Create a new link.  This will run over SCTP/M3UA
index 2e14f277f825da9801f3717e128678c4c3cb9fc3..3a3e803851ec2b13a54dc5860b850d146f894866 100644 (file)
@@ -557,8 +557,14 @@ static int m3ua_shutdown(struct mtp_link *mtp_link)
        struct mtp_m3ua_client_link *link = mtp_link->data;
 
        if (link->asptm_active) {
-               /* need to allow the event loop to actually send the message */
+               /* clear pending events */
+               osmo_timer_del(&link->connect_timer);
+               osmo_timer_del(&link->t_beat);
+               osmo_timer_del(&link->t_ack);
+
                m3ua_send_aspdn(link);
+
+               /* need to allow the event loop to actually send the message */
                schedule_aspdn_t_ack(link);
        } else
                clear_link(link);