[PATCH] osmo-sgsn[master]: Check for correct P-TMSI allocation

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/.

Max gerrit-no-reply at lists.osmocom.org
Mon Oct 9 14:28:17 UTC 2017


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

Check for correct P-TMSI allocation

Do not assign new P-TMSI if allocation failed.

Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a
---
M src/gprs/gprs_gmm.c
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/68/4168/1

diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index dff84a9..d11ecce 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -1242,8 +1242,11 @@
 	/* Don't change the P-TMSI if a P-TMSI re-assignment is under way */
 	if (ctx->gmm_state != GMM_COMMON_PROC_INIT) {
 		ptmsi = sgsn_alloc_ptmsi();
-		ctx->p_tmsi_old = ctx->p_tmsi;
-		ctx->p_tmsi = ptmsi;
+		if (ptmsi != GSM_RESERVED_TMSI) {
+			ctx->p_tmsi_old = ctx->p_tmsi;
+			ctx->p_tmsi = ptmsi;
+		} else
+			LOGMMCTXP(LOGL_ERROR, ctx, "P-TMSI allocation failure: using old one.\n");
 	}
 	ctx->gmm_state = GMM_COMMON_PROC_INIT;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list