From 9f1f3ad7bb2826057292bfc9a29245041aeff9b5 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 2 May 2010 12:56:57 +0200 Subject: [PATCH] [gprs] GMM: update MM context RA ID / TLLI when appropriate --- openbsc/src/gsm_04_08_gprs.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/openbsc/src/gsm_04_08_gprs.c b/openbsc/src/gsm_04_08_gprs.c index ef61adecc..1980c2266 100644 --- a/openbsc/src/gsm_04_08_gprs.c +++ b/openbsc/src/gsm_04_08_gprs.c @@ -1,7 +1,7 @@ /* GSM Mobile Radio Interface Layer 3 messages on the A-bis interface * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ -/* (C) 2009 by Harald Welte +/* (C) 2009-2010 by Harald Welte * * All Rights Reserved * @@ -292,6 +292,7 @@ static int gsm48_rx_gmm_att_req(struct msgb *msg) uint32_t tmsi; char mi_string[GSM48_MI_SIZE]; struct gprs_ra_id ra_id; + uint16_t cid; struct sgsn_mm_ctx *ctx; DEBUGP(DMM, "GMM ATTACH REQUEST "); @@ -300,7 +301,7 @@ static int gsm48_rx_gmm_att_req(struct msgb *msg) * with a foreign TLLI (P-TMSI that was allocated to the MS before), * or with random TLLI. */ - bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); + cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); /* MS network capability 10.5.5.12 */ msnc_len = *cur++; @@ -367,8 +368,11 @@ static int gsm48_rx_gmm_att_req(struct msgb *msg) } break; default: - break; + return 0; } + /* Update MM Context with currient RA and Cell ID */ + ctx->ra = ra_id; + ctx->cell_id = cid; /* FIXME: allocate a new P-TMSI (+ P-TMSI signature) */ /* FIXME: update the TLLI with the new local TLLI based on the P-TMSI */ @@ -472,8 +476,10 @@ static int gsm48_rx_gmm_ra_upd_req(struct msgb *msg) return gsm48_tx_gmm_ra_upd_rej(msg, GMM_CAUSE_IMPL_DETACHED); } - /* FIXME: Update the MM context with the new RA-ID */ - /* FIXME: Update the MM context with the new TLLI */ + /* Update the MM context with the new RA-ID */ + bssgp_parse_cell_id(&mmctx->ra, msgb_bcid(msg)); + /* Update the MM context with the new TLLI */ + mmctx->tlli = msgb_tlli(msg); /* FIXME: Update the MM context with the MS radio acc capabilities */ /* FIXME: Update the MM context with the MS network capabilities */