gbproxy: Avoid multiple tlli_info entries with the same IMSI
Currently it is possible to create several tlli_info entries with the
same IMSI.
This patch disables this by adding a check before the imsi field
is updated.
Sponsored-by: On-Waves ehf
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index c4ebc73..cfbe688 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -2959,10 +2959,10 @@
dump_peers(stdout, 0, 0, &gbcfg);
- /* TODO: There is one entry with this TLLI left (since there were 2
- * before the detach precedure started. Add assertions when
- * this is fixed.
- */
+ OSMO_ASSERT(!gbproxy_find_tlli(peer, local_tlli));
+ tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
+ OSMO_ASSERT(tlli_info);
+ OSMO_ASSERT(tlli_info->is_deregistered);
dump_global(stdout, 0);