aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.h
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-11-08 13:27:35 +0700
committerfixeria <vyanitskiy@sysmocom.de>2020-11-10 17:06:39 +0000
commitcb98894eb1d9dfa8a2b040224a0a5605db38a2cf (patch)
tree64091d033624e58fde52c61a3e17eba0bb5cf8c7 /src/bts.h
parent305763dc6f63feada8636f05e9ce22b8d880e152 (diff)
TLLI 0x00000000 is a valid TLLI, use 0xffffffff instead
The assumption that TLLI 0x00000000 is invalid and can be used as the initializer is wrong. Similar to TMSI, 0x00000000 is a perfectly valid value, while 0xffffffff is reserved - use it. According to 3GPP TS 23.003, section 2.4, a TMSI/P-TMSI with all 32 bits equal to 1 is special and shall not be allocated by the network. The reason is that it must be stored on the SIM, where 'ff'O represents the erased state. According to section 2.6 of the same document, a local/foreign TLLI is derived from P-TMSI, so the same rule applies to TLLI. I manually checked and corrected all occurances of 'tlli' in the code. The test expectations have been adjusted with this command: $ find tests/ -name "*.err" | xargs sed -i "s/0x00000000/0xffffffff/g" so there should be no behavior change. The only exception is the 'TypesTest', where TLLI 0xffffffff is being encoded and expected in the hexdump, so I regenerated the test output. Change-Id: Ie89fab75ecc1d8b5e238d3ff214ea7ac830b68b5 Related: OS#4844
Diffstat (limited to 'src/bts.h')
-rw-r--r--src/bts.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bts.h b/src/bts.h
index 4d5d0dfd..6f757158 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -29,6 +29,7 @@ extern "C" {
#include <osmocom/core/tdef.h>
#include <osmocom/gsm/l1sap.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
+#include <osmocom/gsm/gsm48.h>
#include "mslot_class.h"
#include "gsm_rlcmac.h"
}
@@ -340,7 +341,7 @@ public:
void set_max_mcs_ul(uint8_t mcs_ul);
GprsMsStorage &ms_store();
- GprsMs *ms_by_tlli(uint32_t tlli, uint32_t old_tlli = 0);
+ GprsMs *ms_by_tlli(uint32_t tlli, uint32_t old_tlli = GSM_RESERVED_TMSI);
GprsMs *ms_by_imsi(const char *imsi);
GprsMs *ms_alloc(uint8_t ms_class, uint8_t egprs_ms_class = 0);