aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-02-25 15:22:57 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-03 16:19:12 +0100
commita0da2dbe9e8db9bed591bdcedb26a601adcf1a32 (patch)
tree65388b1aadf3077e370f02c19a3c7b33a966920a /openbsc/src/gprs
parent7df570525181d3ff4305d5e690f10f99e5426332 (diff)
WIP: gprs_gmm: Get mm ctx from RA update in Iu mode
Iu mode doesn't have tlli, so look up according to p-tmsi
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gprs_gmm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index ee3f9bfed..47302a359 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -1284,7 +1284,19 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
* is an optimization to avoid the RA reject (impl detached)
* below, which will cause a new attach cycle. */
/* Look-up the MM context based on old RA-ID and TLLI */
- mmctx = sgsn_mm_ctx_by_tlli_and_ptmsi(msgb_tlli(msg), &old_ra_id);
+ if (!msg->dst) {
+ mmctx = sgsn_mm_ctx_by_tlli_and_ptmsi(msgb_tlli(msg), &old_ra_id);
+ } else if (TLVP_PRESENT(&tp, GSM48_IE_GMM_ALLOC_PTMSI)) {
+ /* In Iu mode search only for ptmsi */
+ char mi_string[GSM48_MI_SIZE];
+ 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;
+ 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 (mmctx) {
LOGMMCTXP(LOGL_INFO, mmctx,
"Looked up by matching TLLI and P_TMSI. "