From aad87b66e8aa086443fe29b0367c619496a801e2 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 24 Jul 2019 16:36:45 +0700 Subject: [PATCH] gprs_bssgp_pcu_rx_dl_ud(): fix: BSSGP_IE_IMSI is optional Change-Id: I940d220a399166122f33e67a222dd572085e1401 --- src/gprs_bssgp_pcu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index b34659b2..3ea3e591 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -118,7 +118,11 @@ static int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp) /* read IMSI. if no IMSI exists, use first paging block (any paging), * because during attachment the IMSI might not be known, so the MS * will listen to all paging blocks. */ - gsm48_mi_to_string(imsi, sizeof(imsi), TLVP_VAL(tp, BSSGP_IE_IMSI), TLVP_LEN(tp, BSSGP_IE_IMSI)); + if (TLVP_PRESENT(tp, BSSGP_IE_IMSI)) + { + gsm48_mi_to_string(imsi, sizeof(imsi), TLVP_VAL(tp, BSSGP_IE_IMSI), + TLVP_LEN(tp, BSSGP_IE_IMSI)); + } #if 0 /* Do not rely on this IE. TODO: make this configurable */ /* parse ms radio access capability */