[PATCH] osmo-iuh[master]: rua: discard context maps on id-Disconnect

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sun Dec 24 23:46:44 UTC 2017


Review at  https://gerrit.osmocom.org/5575

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
---
M src/hnbgw_rua.c
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/75/5575/1

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 @@
 	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 @@
 	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 @@
 
 	rc = osmo_sccp_user_sap_down(cn->sccp_user, &prim->oph);
 
+	if (release_context_map)
+		context_map_deactivate(map);
+
 	return rc;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/5575
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9616f72bfa566de081098ee13e720ff0f5266c77
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list