[MERGED] 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
Tue Oct 10 08:17:49 UTC 2017


Max has submitted this change and it was merged.

Change subject: Check for correct P-TMSI allocation
......................................................................


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(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list