From ce1766301711f0eb0369a8d3168605ed17a46163 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 28 Apr 2025 15:38:06 +0200 Subject: [PATCH] Release all user plane resources when going to IDLE Release all SDAP entities for a UE in nr_rrc_going_to_IDLE(). With this change the SDAP entities of the UE are cleaned up when going into RRC_IDLE, including tun sockets, threads etc. A new SDAP entity is created when re-attaching to the network. --- openair2/RRC/NR_UE/rrc_UE.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index b36c2d676d..4abc712507 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2562,6 +2562,9 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc, nr_pdcp_release_drb(rrc->ue_id, i); } } + // stop TUN threads and clean up SDAP entities + nr_sdap_delete_ue_entities(rrc->ue_id); + for (int i = 1; i < NR_NUM_SRB; i++) { if (rrc->Srb[i] != RB_NOT_PRESENT) { rrc->Srb[i] = RB_NOT_PRESENT;