aboutsummaryrefslogtreecommitdiffstats
path: root/src/hnbgw_rua.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-12-24 21:49:44 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2017-12-25 00:46:12 +0100
commitb10e2937d94d30a9c33bb70ea291c856868490be (patch)
tree5ec79c9f26af8007c20173155f6eb6399bceea71 /src/hnbgw_rua.c
parentaa3e9ebcb409e97ab3e61f17df7c154b8455d568 (diff)
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
Diffstat (limited to 'src/hnbgw_rua.c')
-rw-r--r--src/hnbgw_rua.c5
1 files changed, 5 insertions, 0 deletions
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;
}