diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-09-22 13:30:46 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-10-09 17:56:16 +0200 |
commit | d211d1d999586e10c0e1949862536d378f4fecf7 (patch) | |
tree | 4cccd05a5831c2005d2599d4bd77e77c90de6dac | |
parent | 9c65c8116fac1c99ba6eeb380e2cced26fbb5052 (diff) |
gbproxy: Reset IMSI acquisition within gbproxy_unregister_link_info
Currently then link_info is not cleaned up completely, when
gbproxy_unregister_link_info is called.
This patch adds a function gbproxy_reset_link that must be defined
externally. This is done in gb_proxy.c, where it resets the IMSI
acquisition.
Sponsored-by: On-Waves ehf
-rw-r--r-- | openbsc/include/openbsc/gb_proxy.h | 1 | ||||
-rw-r--r-- | openbsc/src/gprs/gb_proxy.c | 6 | ||||
-rw-r--r-- | openbsc/src/gprs/gb_proxy_tlli.c | 2 | ||||
-rw-r--r-- | openbsc/tests/gbproxy/gbproxy_test.ok | 2 |
4 files changed, 10 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h index 1d1812ff2..c1882f383 100644 --- a/openbsc/include/openbsc/gb_proxy.h +++ b/openbsc/include/openbsc/gb_proxy.h @@ -224,6 +224,7 @@ uint32_t gbproxy_make_bss_ptmsi(struct gbproxy_peer *peer, uint32_t sgsn_ptmsi); uint32_t gbproxy_make_sgsn_tlli( struct gbproxy_peer *peer, struct gbproxy_link_info *link_info, uint32_t bss_tlli); +void gbproxy_reset_link(struct gbproxy_link_info *link_info); int gbproxy_check_imsi( struct gbproxy_peer *peer, const uint8_t *imsi, size_t imsi_len); diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 9aeb010be..867364d8f 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -76,6 +76,7 @@ static int gbprox_relay2peer(struct msgb *old_msg, struct gbproxy_peer *peer, uint16_t ns_bvci); static int gbprox_relay2sgsn(struct gbproxy_config *cfg, struct msgb *old_msg, uint16_t ns_bvci, uint16_t sgsn_nsei); +static void gbproxy_reset_imsi_acquisition(struct gbproxy_link_info* link_info); static int check_peer_nsei(struct gbproxy_peer *peer, uint16_t nsei) { @@ -273,6 +274,11 @@ uint32_t gbproxy_make_sgsn_tlli(struct gbproxy_peer *peer, return sgsn_tlli; } +void gbproxy_reset_link(struct gbproxy_link_info *link_info) +{ + gbproxy_reset_imsi_acquisition(link_info); +} + /* Returns != 0 iff IMSI acquisition was in progress */ static int gbproxy_restart_imsi_acquisition(struct gbproxy_link_info* link_info) { diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/openbsc/src/gprs/gb_proxy_tlli.c index fdb1509f8..fae05edf8 100644 --- a/openbsc/src/gprs/gb_proxy_tlli.c +++ b/openbsc/src/gprs/gb_proxy_tlli.c @@ -367,6 +367,8 @@ static void gbproxy_unregister_link_info(struct gbproxy_peer *peer, link_info->is_deregistered = 1; + gbproxy_reset_link(link_info); + return; } diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok index 16e9d48f4..d0c9d610d 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.ok +++ b/openbsc/tests/gbproxy/gbproxy_test.ok @@ -5580,7 +5580,7 @@ Peers: Attach Reject count : 1 TLLI cache size : 1 TLLI-Cache: 1 - TLLI 00000000, IMSI 12131415161718, AGE 0, STORED 1, IMSI acquisition in progress, DE-REGISTERED + TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED Gbproxy global: Test TLLI info expiry |