From b10e2937d94d30a9c33bb70ea291c856868490be Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sun, 24 Dec 2017 21:49:44 +0100 Subject: rua: discard context maps on id-Disconnect When an id-Disconnect is received, the RUA to SCCP user context becomes unused. Mark the context map as inactive in that case. It will be cleaned up by the context map garbage collector. Related: OS#2776 Change-Id: I9616f72bfa566de081098ee13e720ff0f5266c77 --- src/hnbgw_rua.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 305b8cc..1d0ffbd 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -185,6 +185,7 @@ static int rua_to_scu(struct hnb_context *hnb, struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink; struct osmo_sccp_addr *remote_addr; bool is_ps; + bool release_context_map = false; int rc; switch (cN_DomainIndicator) { @@ -239,6 +240,7 @@ static int rua_to_scu(struct hnb_context *hnb, case OSMO_SCU_PRIM_N_DISCONNECT: prim->u.disconnect.conn_id = map->scu_conn_id; prim->u.disconnect.cause = cause; + release_context_map = true; break; case OSMO_SCU_PRIM_N_UNITDATA: prim->u.unitdata.called_addr = *remote_addr; @@ -261,6 +263,9 @@ static int rua_to_scu(struct hnb_context *hnb, rc = osmo_sccp_user_sap_down(cn->sccp_user, &prim->oph); + if (release_context_map) + context_map_deactivate(map); + return rc; } -- cgit v1.2.3