From deb227b98e4136f873f76ea3362bfb74673f48bc Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Wed, 16 Mar 2016 18:39:52 +0100 Subject: gprs_gmm: Fix RA UPD handling for IU mode --- openbsc/src/gprs/gprs_gmm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'openbsc/src/gprs') diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index cb61593f8..e96dbcdc8 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1326,10 +1326,15 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, uint8_t mi_len = TLVP_LEN(&tp, GSM48_IE_GMM_ALLOC_PTMSI); uint8_t *mi = TLVP_VAL(&tp, GSM48_IE_GMM_ALLOC_PTMSI); uint8_t mi_type = *mi & GSM_MI_TYPE_MASK; + uint32_t tmsi; + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); - if (mi_type == GSM_MI_TYPE_TMSI) - mmctx = sgsn_mm_ctx_by_ptmsi(mi_string); + if (mi_type == GSM_MI_TYPE_TMSI) { + memcpy(&tmsi, mi+1, 4); + tmsi = ntohl(tmsi); + mmctx = sgsn_mm_ctx_by_ptmsi(tmsi); + } } if (mmctx) { LOGMMCTXP(LOGL_INFO, mmctx, -- cgit v1.2.3