aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/gbproxy/gbproxy_test.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-30 17:15:43 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-02 09:00:09 +0100
commit59ac49dc1fd3b1435ef2eeb0b5daf555a946cde6 (patch)
tree365b614cc524208ad269407eb037279a6f552120 /openbsc/tests/gbproxy/gbproxy_test.c
parent175a240285897317fff4a94e4f9b62408797b4b6 (diff)
gbproxy: Reset TLLIs when the link_info is found by IMSI/P-TMSI
Currently when the MS does a re-attach without doing a proper detach first, the gbproxy uses the old local TLLI if patching and the keep mode are enabled. This leads to a failing attachment procedure when TLLI patching is also enabled. This patch changes gbproxy_update_link_state_ul to reset all TLLIs within the link_info if the message contains an unknown TLLI and an MI. This is generally the case with Attach Request messages. The gbproxy_get_link_info_ul gets an additional tlli_is_valid output parameter that is set, when a TLLI was present and found. This flag is then used instead of checking tlli.current == 0 to set TLLI/P-TMSI e.g. Attach Requests when a link_info was already present for the P-TMSI/IMSI used in such a request. Ticket: OW#1324 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/gbproxy/gbproxy_test.c')
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index e35b3628f..d3ce39b7b 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -4116,16 +4116,12 @@ static void test_gbproxy_keep_info()
link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- /* FIXME: The gbproxy still uses local_tlli instead of foreign_tlli.
- * Uncomment the assertions below and remove the
- * gbproxy_link_info_by_tlli line below when this is fixed. */
- /* OSMO_ASSERT(link_info); */
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
+ OSMO_ASSERT(link_info);
OSMO_ASSERT(link_info == link_info2);
OSMO_ASSERT(link_info->imsi_len != 0);
OSMO_ASSERT(!link_info->is_deregistered);
OSMO_ASSERT(!link_info->imsi_acq_pending);
- /* OSMO_ASSERT(link_info->sgsn_tlli.current == foreign_tlli); */
+ OSMO_ASSERT(link_info->sgsn_tlli.current == foreign_tlli);
OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
@@ -4231,16 +4227,12 @@ static void test_gbproxy_keep_info()
link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- /* FIXME: The gbproxy still uses local_tlli instead of foreign_tlli.
- * Uncomment the assertions below and remove the
- * gbproxy_link_info_by_tlli line below when this is fixed. */
- /* OSMO_ASSERT(link_info); */
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
+ OSMO_ASSERT(link_info);
OSMO_ASSERT(link_info == link_info2);
OSMO_ASSERT(link_info->imsi_len != 0);
OSMO_ASSERT(!link_info->is_deregistered);
OSMO_ASSERT(!link_info->imsi_acq_pending);
- /* OSMO_ASSERT(link_info->sgsn_tlli.current == foreign_tlli); */
+ OSMO_ASSERT(link_info->sgsn_tlli.current == foreign_tlli);
OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,