aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-08-16 21:36:32 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-08-17 16:23:27 +0200
commitfea17f8b8cc4835c9a92dfa018e38de0d6fc8cb5 (patch)
tree1b4be444f39cb1f598d3644e8c085ecc29e36bb5
parentaf9a39d9542c1f4f337fe2cc5596000eb2c60d53 (diff)
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
-rw-r--r--src/gprs_ms_storage.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gprs_ms_storage.cpp b/src/gprs_ms_storage.cpp
index 515ed75..36f9b6b 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)