laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29332 )
Change subject: hnbgw_rx_hnb_deregister: Don't call hnb_context_release() ......................................................................
hnbgw_rx_hnb_deregister: Don't call hnb_context_release()
Don't release the HNB context as there's plenty of code that assumes there's always a HNB context associated with a SCTP connection.
Instead, simply unset the hnb_registered flag in the context when processing a HNB_DE-REGISTER.
Related: OS#5676
Change-Id: Id5c4f5c900ea049f54afbf58edb84b4dc00b1dcb --- M include/osmocom/hnbgw/hnbgw.h M src/osmo-hnbgw/hnbgw_hnbap.c 2 files changed, 3 insertions(+), 3 deletions(-)
Approvals: Jenkins Builder: Verified neels: Looks good to me, but someone else must approve laforge: Looks good to me, approved
diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h index af89008..778fa45 100644 --- a/include/osmocom/hnbgw/hnbgw.h +++ b/include/osmocom/hnbgw/hnbgw.h @@ -84,6 +84,7 @@ struct llist_head map_list; };
+/* The lifecycle of the hnb_context object is the same as its conn */ struct hnb_context { /*! Entry in HNB-global list of HNB */ struct llist_head list; @@ -101,8 +102,7 @@ /*! SCTP stream ID for RUA */ uint16_t rua_stream;
- /*! True if a HNB-REGISTER-REQ from this HNB has been accepted. Note that - * this entire data structure is freed if the HNB sends HNB-DE-REGISTER-REQ. */ + /*! True if a HNB-REGISTER-REQ from this HNB has been accepted. */ bool hnb_registered;
/* linked list of hnbgw_context_map */ diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c index 98cec76..1d81e83 100644 --- a/src/osmo-hnbgw/hnbgw_hnbap.c +++ b/src/osmo-hnbgw/hnbgw_hnbap.c @@ -388,7 +388,7 @@ LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "HNB-DE-REGISTER cause=%s\n", hnbap_cause_str(&ies.cause));
hnbap_free_hnbde_registeries(&ies); - hnb_context_release(ctx); + ctx->hnb_registered = false;
return 0; }