Remove "global" UE variable spCellConfig
Variable spCellConfig is only used in function rrc_add_nsa_user(). Make it local to this function to prevent possible bugs (limit the possible scope as much as possible).
This commit is contained in:
@@ -317,7 +317,6 @@ typedef struct gNB_RRC_UE_s {
|
||||
uint32_t ue_rrc_inactivity_timer;
|
||||
uint32_t ue_reestablishment_counter;
|
||||
uint32_t ue_reconfiguration_counter;
|
||||
struct NR_SpCellConfig *spCellConfig;
|
||||
|
||||
/* NGUEContextSetup might come with PDU sessions, but setup needs to be
|
||||
* delayed after security (and capability); PDU sessions are stored here */
|
||||
|
||||
@@ -228,9 +228,6 @@ static void init_NR_SI(gNB_RRC_INST *rrc)
|
||||
if (get_softmodem_params()->phy_test > 0 || get_softmodem_params()->do_ra > 0) {
|
||||
AssertFatal(NODE_IS_MONOLITHIC(rrc->node_type), "phy_test and do_ra only work in monolithic\n");
|
||||
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_allocate_new_ue_context(rrc);
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
UE->spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig));
|
||||
UE->spCellConfig->spCellConfigDedicated = RC.nrmac[0]->common_channels[0].pre_ServingCellConfig;
|
||||
LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p);
|
||||
if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
rrc_add_nsa_user(rrc,ue_context_p,NULL);
|
||||
|
||||
@@ -106,8 +106,6 @@ void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerL
|
||||
LOG_A(NR_RRC, "Successfully decoded UE NR capabilities (NR and MRDC)\n");
|
||||
|
||||
AssertFatal(NODE_IS_MONOLITHIC(rrc->node_type), "phy_test and do_ra only work in monolithic\n");
|
||||
UE->spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig));
|
||||
UE->spCellConfig->spCellConfigDedicated = RC.nrmac[0]->common_channels[0].pre_ServingCellConfig;
|
||||
LOG_I(NR_RRC,"Adding new NSA user (%p)\n",ue_context_p);
|
||||
rrc_add_nsa_user(rrc,ue_context_p, m);
|
||||
}
|
||||
@@ -238,7 +236,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
|
||||
UE->rb_config = get_default_rbconfig(m->e_rabs_tobeadded[0].e_rab_id, m->e_rabs_tobeadded[0].drb_ID, cipher_algo, NR_SecurityConfig__keyToUse_secondary);
|
||||
}
|
||||
|
||||
NR_ServingCellConfig_t *scc = UE->spCellConfig ? UE->spCellConfig->spCellConfigDedicated : NULL;
|
||||
NR_ServingCellConfig_t *scc = RC.nrmac[0]->common_channels[0].pre_ServingCellConfig;
|
||||
// The MAC has the ServingCellConfigCommon; the below code is incorrect: the
|
||||
// CU should send a UE Context Setup Request to request the creating of the
|
||||
// MAC Context
|
||||
|
||||
Reference in New Issue
Block a user