From b04885005b1ca4b2207cfad726175525e4e5c77d Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 12 Mar 2024 18:03:10 +0100 Subject: [PATCH] Free UE contexts when starting shutdown procedure They are not valid anymore since the Iuh conn is closed. If kept alive, then if GTP/RTP traffic comes from CN while shutting down the payloads may be forwarded to LLSK which may have been closed (eg. because shutdown procedure was started precisely due to death LLSK because other end closed it). Related: OS#6826 Change-Id: I51aa449e7fd5b1049fcaaeef3f1378423a838c05 --- src/osmo-hnodeb/hnb_shutdown_fsm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/osmo-hnodeb/hnb_shutdown_fsm.c b/src/osmo-hnodeb/hnb_shutdown_fsm.c index 9d7e186..c97a124 100644 --- a/src/osmo-hnodeb/hnb_shutdown_fsm.c +++ b/src/osmo-hnodeb/hnb_shutdown_fsm.c @@ -45,12 +45,18 @@ static void st_none_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state) static void st_none(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct hnb *hnb = (struct hnb *)fi->priv; + struct hnb_ue *ue, *ue_tmp; + switch (event) { case HNB_SHUTDOWN_EV_START: /* TODO: here we may want to communicate to lower layers over UDsocket that we are shutting down... * TODO: Also, if Iuh link is still up, maybe send a Hnb deregister req towards HNBGW - * TODO: also signal the hnb object somehow that we are starting to shut down? */ + + /* Drop active UE contexts, together with their GTP/AUDIO sessions: */ + llist_for_each_entry_safe(ue, ue_tmp, &hnb->ue_list, list) + hnb_ue_free(ue); + if (osmo_stream_cli_is_connected(hnb->iuh.client)) osmo_stream_cli_close(hnb->iuh.client);