From a980d479180b203488a07bada787d1fae7afeeed Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 6 Dec 2022 15:12:07 +0000 Subject: [PATCH] Add warning comment related with accessing MAC structures directly from RRC --- openair2/RRC/NR/rrc_gNB.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index fef28c3a62..a105a3002c 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1939,6 +1939,7 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, if ((ue_context_p = rrc_gNB_ue_context_5g_s_tmsi_exist(RC.nrrrc[ctxt_pP->module_id], s_tmsi_part1))) { LOG_I(NR_RRC, " 5G-S-TMSI-Part1 exists, ue_context_p %p, old rnti %x => %x\n",ue_context_p, ue_context_p->ue_context.rnti, ctxt_pP->rnti); + // TODO: MAC structures should not be accessed directly from the RRC! An implementation using the F1 interface should be developed. gNB_MAC_INST *nrmac=RC.nrmac[ctxt_pP->module_id]; //WHAT A BEAUTIFULL RACE CONDITION !!! mac_remove_nr_ue(nrmac, ue_context_p->ue_context.rnti); @@ -3829,6 +3830,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { // 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) { if(!NODE_IS_CU(RC.nrrrc[ctxt_pP->instance]->node_type)){ + // TODO: MAC structures should not be accessed directly from the RRC! An implementation using the F1 interface should be developed. mac_remove_nr_ue(nrmac, ctxt_pP->rnti); rrc_rlc_remove_ue(ctxt_pP); pdcp_remove_UE(ctxt_pP); @@ -3864,6 +3866,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { ue_context_p->ue_context.rnti); ue_context_p->ue_context.ue_release_timer_rrc = 0; + // TODO: MAC structures should not be accessed directly from the RRC! An implementation using the F1 interface should be developed. mac_remove_nr_ue(nrmac, ctxt_pP->rnti); rrc_rlc_remove_ue(ctxt_pP); pdcp_remove_UE(ctxt_pP);