aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy_tlli.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-20 16:30:06 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-27 11:17:11 +0100
commit91e9f555b6a091663c192c9cd3b8d022a2690eed (patch)
tree640fe07697e4dd5f319869cc1f2f60dbec8bfeec /openbsc/src/gprs/gb_proxy_tlli.c
parente99c333d61bd5ac6fcd842313ffb4196be42fdab (diff)
gbproxy: Fix P-TMSI generation for repeated Attach Accept messages
Currently, when P-TMSI patching is enabled, a new BSS P-TMSI is generated for each Attach Accept. So two duplicated, subsequent Attach Accept messages will be mapped to different BSS side P-TMSI. Because the last one will replace former ones in the link_info struct, the MS will fail to access the SGSN if it uses the former P-TMSI to derive the new TLLI. This patch checks the SGSN P-TMSI already assigned to the link_info and only generates a new BSS P-TMSI on mismatch (or if the BSS P-TMSI hasn't been set yet). Ticket: OW#1322 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy_tlli.c')
-rw-r--r--openbsc/src/gprs/gb_proxy_tlli.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/openbsc/src/gprs/gb_proxy_tlli.c
index 138837eff..467006e87 100644
--- a/openbsc/src/gprs/gb_proxy_tlli.c
+++ b/openbsc/src/gprs/gb_proxy_tlli.c
@@ -557,9 +557,14 @@ struct gbproxy_link_info *gbproxy_update_link_state_dl(
/* A new P-TMSI has been signalled in the message,
* register new TLLI */
uint32_t new_sgsn_ptmsi;
- uint32_t new_bss_ptmsi;
+ uint32_t new_bss_ptmsi = GSM_RESERVED_TMSI;
gprs_parse_tmsi(parse_ctx->new_ptmsi_enc, &new_sgsn_ptmsi);
- new_bss_ptmsi = gbproxy_make_bss_ptmsi(peer, new_sgsn_ptmsi);
+
+ if (link_info->sgsn_tlli.ptmsi == new_sgsn_ptmsi)
+ new_bss_ptmsi = link_info->tlli.ptmsi;
+
+ if (new_bss_ptmsi == GSM_RESERVED_TMSI)
+ new_bss_ptmsi = gbproxy_make_bss_ptmsi(peer, new_sgsn_ptmsi);
LOGP(DGPRS, LOGL_INFO,
"Got new PTMSI %08x from SGSN, using %08x for BSS\n",