summaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-31 10:47:29 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-11-11 22:44:32 +0100
commit41108680293f703da976efe64ea8388ef7a2cd7e (patch)
tree110fe199479f62bccc7b85e03bf2b2aff95ed172 /openbsc/src/gprs/gb_proxy.c
parent0d8ac0eac0a919cb2620d94e661d60b2a96501d3 (diff)
gbproxy: Honour the BSS TLLI type when creating an SGSN TLLI
Currently gbproxy_make_sgsn_tlli always returns a foreign TLLI when it uses the (SGSN) P-TMSI to generate one. This patch changes the implementation to return a SGSN TLLI of the same type like the BSS TLLI in that case. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy.c')
-rw-r--r--openbsc/src/gprs/gb_proxy.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index ee296d1..21cd405 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -254,9 +254,14 @@ uint32_t gbproxy_make_sgsn_tlli(struct gbproxy_peer *peer,
int max_retries = 23;
if (!peer->cfg->patch_ptmsi) {
sgsn_tlli = bss_tlli;
- } else if (link_info->sgsn_tlli.ptmsi != GSM_RESERVED_TMSI) {
+ } else if (link_info->sgsn_tlli.ptmsi != GSM_RESERVED_TMSI &&
+ gprs_tlli_type(bss_tlli) == TLLI_FOREIGN) {
sgsn_tlli = gprs_tmsi2tlli(link_info->sgsn_tlli.ptmsi,
TLLI_FOREIGN);
+ } else if (link_info->sgsn_tlli.ptmsi != GSM_RESERVED_TMSI &&
+ gprs_tlli_type(bss_tlli) == TLLI_LOCAL) {
+ sgsn_tlli = gprs_tmsi2tlli(link_info->sgsn_tlli.ptmsi,
+ TLLI_LOCAL);
} else {
do {
/* create random TLLI, 0b01111xxx... */