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
This commit is contained in:
Jacob Erlbeck 2014-09-22 13:30:46 +02:00 committed by Holger Hans Peter Freyther
parent 538bee0753
commit 4abbbdd841
4 changed files with 10 additions and 1 deletions

View File

@ -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);

View File

@ -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)
{

View File

@ -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;
}

View File

@ -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