bsc: Keep all active subscriber connections in a list.
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 6c2a467..5048f2b 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -33,6 +33,8 @@
#include <osmocore/talloc.h>
+static LLIST_HEAD(sub_connections);
+
static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind);
static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id);
@@ -48,6 +50,7 @@
conn->lchan = lchan;
conn->bts = lchan->ts->trx->bts;
lchan->conn = conn;
+ llist_add_tail(&conn->entry, &sub_connections);
return conn;
}
@@ -70,6 +73,8 @@
if (conn->ho_lchan)
LOGP(DNM, LOGL_ERROR, "The ho_lchan should have been cleared.\n");
+ llist_del(&conn->entry);
+
lchan = conn->lchan;
talloc_free(conn);