From 1beffd1ecc34e18a17319e81204bb92d6176523c Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 22 Jul 2021 14:05:10 +0100 Subject: [PATCH] Remove the MAC and RRC context after UL failure when gNB is not connected to CN5G --- openair2/RRC/NR/rrc_gNB.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 8ad6b5c8e6..6ef8149bb1 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -3070,7 +3070,10 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { ue_context_p, NGAP_CAUSE_RADIO_NETWORK, 30); - }else{ + } + + // Remove here the MAC and RRC context when RRC is not connected or gNB is not connected to CN5G + if(ue_context_p->ue_context.StatusRrc < NR_RRC_CONNECTED || ue_context_p->ue_context.gNB_ue_ngap_id == 0) { mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); rrc_rlc_remove_ue(ctxt_pP); pdcp_remove_UE(ctxt_pP); @@ -3082,6 +3085,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); } } + break; // break RB_FOREACH } }