neels submitted this change.
release UE Contexts on HNB (Re-)Register
Whenever a HNB reconnects, we want to discard all previous UE state and
any active connections.
In one HNB reconnect scenario, we receive SCTP_RESTART. This sets
hnb_registered == false, which in turn skipped the UE cleanup step in
hnbgw_rx_hnb_register_req(), leaking UE Contexts.
Remove all weird conditions like that, and simply clear out all UE state
whenever a HNB registers, period.
Change-Id: I370966d2d76fd263714e727918fcc1ea2f2315fa
---
M src/osmo-hnbgw/hnbgw_hnbap.c
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c
index 19ebd38..a1cbec5 100644
--- a/src/osmo-hnbgw/hnbgw_hnbap.c
+++ b/src/osmo-hnbgw/hnbgw_hnbap.c
@@ -469,13 +469,11 @@
ctx->identity_info, ctx->id.mcc, ctx->id.mnc, ctx->id.lac, ctx->id.rac, ctx->id.sac, ctx->id.cid,
name, ctx->hnb_registered ? " (re-connecting)" : "");
- if (ctx->hnb_registered) {
- /* The HNB is already registered, and we are seeing a new HNB Register Request. The HNB has restarted
- * without us noticing. Clearly, the HNB does not expect any UE state to be active here, so discard any
- * UE contexts and SCCP connections associated with this HNB. */
- LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "HNB reconnecting, discarding all previous UE state\n");
- hnb_context_release_ue_state(ctx);
- }
+ /* The HNB is already registered, and we are seeing a new HNB Register Request. The HNB has restarted
+ * without us noticing. Clearly, the HNB does not expect any UE state to be active here, so discard any
+ * UE contexts and SCCP connections associated with this HNB. */
+ LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "HNB (re)connecting, discarding all previous UE state\n");
+ hnb_context_release_ue_state(ctx);
ctx->hnb_registered = true;
To view, visit change 32037. To unsubscribe, or for help writing mail filters, visit settings.