aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Santos <jrsantos@jonathanrsantos.com>2011-06-10 16:07:36 -0400
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-10-16 17:50:55 +0200
commitf3884f690f6363db1381aceb578f9eebc8dff3d6 (patch)
treef0bf2c9f6829656463265f7dd891570fe9e2c403
parent3c222e5f792fa41cad451a3f311a33d8ddf25ec2 (diff)
gprs: Fix bug that caused TLLI to change prematurely
-rw-r--r--openbsc/src/gprs/gprs_gmm.c17
-rw-r--r--openbsc/src/gprs/gprs_sgsn.c1
2 files changed, 9 insertions, 9 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 27dfa8a44..57592f959 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -752,10 +752,6 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
* foreign TLLI to local TLLI */
ctx->tlli_new = gprs_tmsi2tlli(ctx->p_tmsi, TLLI_LOCAL);
- /* Inform LLC layer about new TLLI but keep old active */
- gprs_llgmm_assign(ctx->llme, ctx->tlli, ctx->tlli_new,
- GPRS_ALGO_GEA0, NULL);
-
DEBUGPC(DMM, "\n");
return gsm48_gmm_authorize(ctx, GMM_T3350_MODE_ATT);
@@ -977,10 +973,6 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
* foreign TLLI to local TLLI */
mmctx->tlli_new = gprs_tmsi2tlli(mmctx->p_tmsi, TLLI_LOCAL);
- /* Inform LLC layer about new TLLI but keep old active */
- gprs_llgmm_assign(mmctx->llme, mmctx->tlli, mmctx->tlli_new,
- GPRS_ALGO_GEA0, NULL);
-
/* Look at PDP Context Status IE and see if MS's view of
* activated/deactivated NSAPIs agrees with our view */
if (TLVP_PRESENT(&tp, GSM48_IE_GMM_PDP_CTX_STATUS)) {
@@ -1039,6 +1031,9 @@ static int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
DEBUGP(DMM, "-> ATTACH COMPLETE\n");
mmctx_timer_stop(mmctx, 3350);
mmctx->p_tmsi_old = 0;
+ /* Inform LLC layer about new TLLI but keep old active */
+ gprs_llgmm_assign(mmctx->llme, mmctx->tlli, mmctx->tlli_new,
+ GPRS_ALGO_GEA0, NULL);
mmctx->tlli = mmctx->tlli_new;
rc = 0;
break;
@@ -1047,6 +1042,9 @@ static int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
DEBUGP(DMM, "-> ROUTEING AREA UPDATE COMPLETE\n");
mmctx_timer_stop(mmctx, 3350);
mmctx->p_tmsi_old = 0;
+ /* Inform LLC layer about new TLLI but keep old active */
+ gprs_llgmm_assign(mmctx->llme, mmctx->tlli, mmctx->tlli_new,
+ GPRS_ALGO_GEA0, NULL);
mmctx->tlli = mmctx->tlli_new;
rc = 0;
break;
@@ -1054,6 +1052,9 @@ static int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
DEBUGP(DMM, "-> PTMSI REALLLICATION COMPLETE\n");
mmctx_timer_stop(mmctx, 3350);
mmctx->p_tmsi_old = 0;
+ /* Inform LLC layer about new TLLI but keep old active */
+ gprs_llgmm_assign(mmctx->llme, mmctx->tlli, mmctx->tlli_new,
+ GPRS_ALGO_GEA0, NULL);
mmctx->tlli = mmctx->tlli_new;
rc = 0;
break;
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c
index 85f710500..5e8f4d359 100644
--- a/openbsc/src/gprs/gprs_sgsn.c
+++ b/openbsc/src/gprs/gprs_sgsn.c
@@ -108,7 +108,6 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli,
llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
if ((ctx->p_tmsi | 0xC0000000) == tlli ||
(ctx->p_tmsi_old && (ctx->p_tmsi_old | 0xC0000000) == tlli)) {
- ctx->tlli = tlli;
return ctx;
}
}