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
This commit is contained in:
Jacob Erlbeck 2015-08-16 21:36:32 +02:00
parent af9a39d954
commit fea17f8b8c
1 changed files with 3 additions and 1 deletions

View File

@ -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)