From 642fd9996b67689159c9922bf3849c760624ecea Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 19 Dec 2023 08:48:14 +0100 Subject: [PATCH] CU-CP/UP: release UE at PDCP in CU-CP We reuse RRC UE IDs at the RRC. Previous to this commit, we did not release a UE at the CU-CP's PDCP (for SRBs). Thus, when reconnecting a UE, the PDCP might not be in a good state, since we did not release the previous PDCP UE context. --- openair2/RRC/NR/rrc_gNB.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index d967d3623f..ee5afbce48 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1904,6 +1904,10 @@ static void rrc_CU_process_ue_context_release_complete(MessageDef *msg_p) } gNB_RRC_UE_t *UE = &ue_context_p->ue_context; + /* we call nr_pdcp_remove_UE() in the handler of E1 bearer release, but if we + * are in E1, we also need to free the UE in the CU-CP, so call it twice to + * cover all cases */ + nr_pdcp_remove_UE(UE->rrc_ue_id); rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(instance, UE->rrc_ue_id); LOG_I(NR_RRC, "removed UE CU UE ID %u/RNTI %04x \n", UE->rrc_ue_id, UE->rnti); rrc_delete_ue_data(UE);