From fea17f8b8cc4835c9a92dfa018e38de0d6fc8cb5 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Sun, 16 Aug 2015 21:36:32 +0200 Subject: ms: Do not retrieve MS with IMSI 000 from the storage The IMSI '000' is used as default value for an incoming BSSGP message's IMSI IE. This can lead to the retrieval of the wrong MS object from the storage. This commit changes the get_ms method to skip the IMSI search if such an IMSI is passed as selector. Note that changing the default value in the BSSGP code does not help here. Sponsored-by: On-Waves ehf --- src/gprs_ms_storage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gprs_ms_storage.cpp b/src/gprs_ms_storage.cpp index 515ed753..36f9b6ba 100644 --- a/src/gprs_ms_storage.cpp +++ b/src/gprs_ms_storage.cpp @@ -24,6 +24,8 @@ #include "tbf.h" #include "gprs_debug.h" +#define GPRS_UNDEFINED_IMSI "000" + GprsMsStorage::GprsMsStorage(BTS *bts) : m_bts(bts) { @@ -69,7 +71,7 @@ GprsMs *GprsMsStorage::get_ms(uint32_t tlli, uint32_t old_tlli, const char *imsi /* not found by TLLI */ - if (imsi && imsi[0]) { + if (imsi && imsi[0] && strcmp(imsi, GPRS_UNDEFINED_IMSI) != 0) { llist_for_each(pos, &m_list) { ms = pos->entry(); if (strcmp(imsi, ms->imsi()) == 0) -- cgit v1.2.3