aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_sgsn.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-05 15:20:23 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-05 15:20:23 +0200
commitb773fbf335c8b7fda035e37d02bdeb15839d556f (patch)
treedbc8080f439a729934a20d42964d0f896b9c60d0 /openbsc/src/gprs/gprs_sgsn.c
parent58cf664d289a4cb0511d51a66f92e8eb4e7fa597 (diff)
sgsn: Make P-TMSI a local TLLI to avoid clash
Some broken equipment does not convert the P-TMSI to a Local TLLI. This leads to the SGSN ignoring the GPRS Attach Complete message from the phone. Proprietary SGSNs and some documentation we found state that one should always set the two highest bits of a P-TMSI to one. This will help broken equipment and will avoid a potential P-TMSI/TLLI clash. The P-TMSI/Local TLLI mapping is now bijective.
Diffstat (limited to 'openbsc/src/gprs/gprs_sgsn.c')
-rw-r--r--openbsc/src/gprs/gprs_sgsn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c
index 84bf512ae..f92b2de9b 100644
--- a/openbsc/src/gprs/gprs_sgsn.c
+++ b/openbsc/src/gprs/gprs_sgsn.c
@@ -361,7 +361,7 @@ uint32_t sgsn_alloc_ptmsi(void)
uint32_t ptmsi;
restart:
- ptmsi = rand();
+ ptmsi = rand() | 0xC0000000;
llist_for_each_entry(mm, &sgsn_mm_ctxts, list) {
if (mm->p_tmsi == ptmsi)
goto restart;