diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-09-03 11:59:48 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-09-09 10:10:00 +0200 |
commit | 31591142e97268b3add6b99ad5eb9b203a0a37f7 (patch) | |
tree | 44548b50bd6e1945b9106cc28d6219bd2b2b687c /openbsc/include/openbsc/gb_proxy.h | |
parent | ea1698e32203de923ce40b7cf13027b5a9254760 (diff) |
gbproxy: Reset IMSI acquisition and free stored messages in tlli_info
Currently the stored messages are only removed, when IMSI acquisition
has succeeded. In addition, receiving two ATTACH_REQ messages in
sequence (e.g. due to loss of a Identity Req/Resp message) will not
restart the IMSI acquisition procedure.
This patch adds gbproxy_tlli_info_discard_messages() to clean up the
message list and calls it from gbproxy_delete_tlli() fixing a
potential memory leak. It is also called when an Attach Request
message has been received. In that case the imsi_acq_pending flag is
cleared, too. This would (re-)trigger the IMSI acquisition procedure
at each of these messages. If an Ident Response has been lost,
resending the Ident Request with the same N(U) will not work.
Therefore the N(U) gets incremented on each Ident Request generated
by the gbproxy. The first N(U) used is 256 which shouldn't collide
with the V(UT) used by the SGSN given that P-TMSI patching is enabled
(since a new random TLLI is used initially on every new (no
tlli_info) connection and V(U) starts with zero then).
Ticket: OW#1261
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include/openbsc/gb_proxy.h')
-rw-r--r-- | openbsc/include/openbsc/gb_proxy.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h index 9b894632b..e9ca53184 100644 --- a/openbsc/include/openbsc/gb_proxy.h +++ b/openbsc/include/openbsc/gb_proxy.h @@ -150,6 +150,7 @@ struct gbproxy_tlli_info { int imsi_acq_pending; struct llist_head stored_msgs; + int imsi_acq_retries; int enable_patching; }; @@ -197,6 +198,7 @@ void gbproxy_update_tlli_state_after( int gbproxy_remove_stale_tllis(struct gbproxy_peer *peer, time_t now); void gbproxy_delete_tlli(struct gbproxy_peer *peer, struct gbproxy_tlli_info *tlli_info); +void gbproxy_tlli_info_discard_messages(struct gbproxy_tlli_info *tlli_info); struct gbproxy_tlli_info *gbproxy_register_tlli( struct gbproxy_peer *peer, uint32_t tlli, |