Call ms_store->get_ms() with GSM_RESERVED_TMSI instead of 0
That's the special value checked in the implementation of get_ms() to
skip lookups based on TLLI.
This should save some cicles trying to match TLLI 0.
Change-Id: I364d238ff8a82abb14281140fe18b273c0e8f541
diff --git a/src/bts.cpp b/src/bts.cpp
index f77c5a2..df08cc6 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -1389,7 +1389,7 @@
struct GprsMs *bts_ms_by_imsi(struct gprs_rlcmac_bts *bts, const char *imsi)
{
- return bts_ms_store(bts)->get_ms(0, 0, imsi);
+ return bts_ms_store(bts)->get_ms(GSM_RESERVED_TMSI, GSM_RESERVED_TMSI, imsi);
}
const struct llist_head* bts_ms_list(struct gprs_rlcmac_bts *bts)
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index 1745eea..28ecebf 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -236,7 +236,7 @@
int pcu_vty_show_ms_by_imsi(struct vty *vty, struct gprs_rlcmac_bts *bts,
const char *imsi)
{
- GprsMs *ms = bts_ms_store(bts)->get_ms(0, 0, imsi);
+ GprsMs *ms = bts_ms_store(bts)->get_ms(GSM_RESERVED_TMSI, GSM_RESERVED_TMSI, imsi);
if (!ms) {
vty_out(vty, "Unknown IMSI '%s'.%s", imsi, VTY_NEWLINE);
return CMD_WARNING;
diff --git a/src/tbf.cpp b/src/tbf.cpp
index d15cd3d..cb5d9f3 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -225,7 +225,7 @@
if (!ms_check_tlli(ms(), tlli)) {
GprsMs *old_ms;
- old_ms = bts_ms_store(bts)->get_ms(tlli, 0, NULL);
+ old_ms = bts_ms_store(bts)->get_ms(tlli, GSM_RESERVED_TMSI, NULL);
if (old_ms)
ms_merge_and_clear_ms(ms(), old_ms);
}
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 9c99cf6..67ac573 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -295,7 +295,7 @@
/* If we got MS by TLLI above let's see if we already have another MS
* object identified by IMSI and merge them */
if (ms && !ms_imsi_is_valid(ms) && imsi) {
- ms_old = bts_ms_store(bts)->get_ms(0, 0, imsi);
+ ms_old = bts_ms_store(bts)->get_ms(GSM_RESERVED_TMSI, GSM_RESERVED_TMSI, imsi);
if (ms_old && ms_old != ms) {
/* The TLLI has changed (RAU), so there are two MS
* objects for the same MS */