diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2016-03-16 18:39:52 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2016-03-16 18:39:52 +0100 |
commit | deb227b98e4136f873f76ea3362bfb74673f48bc (patch) | |
tree | 93e80b9c3582911e701871bef90e29465d62e73e /openbsc/src/gprs/gprs_gmm.c | |
parent | 5e611021b03f541b579f1b1fd5b421d41a7ec60a (diff) |
gprs_gmm: Fix RA UPD handling for IU mode
Diffstat (limited to 'openbsc/src/gprs/gprs_gmm.c')
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 9 |
1 files changed, 7 insertions, 2 deletions
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, |