aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-10-09 16:26:43 +0200
committerMax <msuraev@sysmocom.de>2017-10-09 16:26:43 +0200
commit7ad8fa65e8ff6bb3f481b2c6c9801a3a5d8aa0e8 (patch)
tree4782570672def3ccfaec7c69b3492833a0908085
parent86e04df8629f275af04982eb1b8d6c6701db5b1c (diff)
Check for correct P-TMSI allocation
Do not assign new P-TMSI if allocation failed. Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a
-rw-r--r--src/gprs/gprs_gmm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index dff84a9e8..d11ecced8 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -1242,8 +1242,11 @@ static inline void ptmsi_update(struct sgsn_mm_ctx *ctx)
/* 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;
}