From c2e8cc4a10d741763736d375bb663c593ee2de31 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 31 May 2010 20:23:38 +0200 Subject: [GPRS] Implement TMSI reallocation and timers 3350 + 3370 Our state transitions and timers now reflect 04.08 for GMM much better than before. Also, we allocate a new P-TMSI on every ATTACH and RA UPDATE, as some phones seem to get confused if they don't get a P-TMSI. --- openbsc/src/gprs/gprs_sgsn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'openbsc/src/gprs/gprs_sgsn.c') diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 0e87e62e0..bab34d8d7 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -84,7 +84,8 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli, tlli_type = gprs_tlli_type(tlli); if (tlli_type == TLLI_LOCAL) { llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) { - if ((ctx->p_tmsi | 0xC0000000) == tlli) { + if ((ctx->p_tmsi | 0xC0000000) == tlli || + (ctx->p_tmsi_old && (ctx->p_tmsi_old | 0xC0000000) == tlli)) { ctx->tlli = tlli; return ctx; } @@ -99,7 +100,8 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_ptmsi(uint32_t p_tmsi) struct sgsn_mm_ctx *ctx; llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) { - if (p_tmsi == ctx->p_tmsi) + if (p_tmsi == ctx->p_tmsi || + (ctx->p_tmsi_old && ctx->p_tmsi_old == p_tmsi)) return ctx; } return NULL; -- cgit v1.2.3