Commit 04251d5b authored by Robert Schmidt's avatar Robert Schmidt

Correctly initialize protocol_ctxt in F1 code

In the previous version, not all fields, and in particular the
`eNB_index`, were not initialized, leading to errors when they were used
(e.g., the PDCP code checks that eNB_index == 0).
parent 50916825
...@@ -197,7 +197,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration ...@@ -197,7 +197,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
} }
char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigurationReq *configuration) { char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigurationReq *configuration) {
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt = { 0 };
gNB_RRC_INST *rrc=RC.nrrrc[gnb_mod_idP]; gNB_RRC_INST *rrc=RC.nrrrc[gnb_mod_idP];
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, GNB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, GNB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP);
LOG_I(NR_RRC, LOG_I(NR_RRC,
...@@ -3030,11 +3030,13 @@ void rrc_gNB_process_dc_overall_timeout(const module_id_t gnb_mod_idP, x2ap_ENDC ...@@ -3030,11 +3030,13 @@ void rrc_gNB_process_dc_overall_timeout(const module_id_t gnb_mod_idP, x2ap_ENDC
static int rrc_process_DU_DL(MessageDef *msg_p, const char *msg_name, instance_t instance) { static int rrc_process_DU_DL(MessageDef *msg_p, const char *msg_name, instance_t instance) {
NRDuDlReq_t * req=&NRDuDlReq(msg_p); NRDuDlReq_t * req=&NRDuDlReq(msg_p);
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt = {
ctxt.rnti = req->rnti; .rnti = req->rnti,
ctxt.module_id = instance; .module_id = instance,
ctxt.instance = instance; .instance = instance,
ctxt.enb_flag = 1; .enb_flag = 1,
.eNB_index = instance
};
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id]; gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
struct rrc_gNB_ue_context_s *ue_context_p = struct rrc_gNB_ue_context_s *ue_context_p =
rrc_gNB_get_ue_context(rrc, ctxt.rnti); rrc_gNB_get_ue_context(rrc, ctxt.rnti);
...@@ -3285,11 +3287,13 @@ return 0; ...@@ -3285,11 +3287,13 @@ return 0;
static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const char *msg_name, instance_t instance){ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const char *msg_name, instance_t instance){
f1ap_ue_context_setup_t * req=&F1AP_UE_CONTEXT_SETUP_REQ(msg_p); f1ap_ue_context_setup_t * req=&F1AP_UE_CONTEXT_SETUP_REQ(msg_p);
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt = {
ctxt.rnti = req->rnti; .rnti = req->rnti,
ctxt.module_id = instance; .module_id = instance,
ctxt.instance = instance; .instance = instance,
ctxt.enb_flag = 1; .enb_flag = 1,
.eNB_index = instance
};
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id]; gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
gNB_MAC_INST *mac = RC.nrmac[ctxt.module_id]; gNB_MAC_INST *mac = RC.nrmac[ctxt.module_id];
struct rrc_gNB_ue_context_s *ue_context_p = struct rrc_gNB_ue_context_s *ue_context_p =
...@@ -3515,11 +3519,13 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha ...@@ -3515,11 +3519,13 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, const char *msg_name, instance_t instance){ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, const char *msg_name, instance_t instance){
f1ap_ue_context_setup_t * req=&F1AP_UE_CONTEXT_MODIFICATION_REQ(msg_p); f1ap_ue_context_setup_t * req=&F1AP_UE_CONTEXT_MODIFICATION_REQ(msg_p);
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt = {
ctxt.rnti = req->rnti; .rnti = req->rnti,
ctxt.module_id = instance; .module_id = instance,
ctxt.instance = instance; .instance = instance,
ctxt.enb_flag = 1; .enb_flag = 1,
.eNB_index = instance
};
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id]; gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
gNB_MAC_INST *mac = RC.nrmac[ctxt.module_id]; gNB_MAC_INST *mac = RC.nrmac[ctxt.module_id];
struct rrc_gNB_ue_context_s *ue_context_p = struct rrc_gNB_ue_context_s *ue_context_p =
...@@ -3664,11 +3670,13 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co ...@@ -3664,11 +3670,13 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co
static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const char *msg_name, instance_t instance){ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const char *msg_name, instance_t instance){
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(msg_p); f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(msg_p);
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt = {
ctxt.rnti = resp->rnti; .rnti = resp->rnti,
ctxt.module_id = instance; .module_id = instance,
ctxt.instance = instance; .instance = instance,
ctxt.enb_flag = 1; .enb_flag = 1,
.eNB_index = instance
};
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id]; gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(rrc, ctxt.rnti); struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(rrc, ctxt.rnti);
NR_CellGroupConfig_t *cellGroupConfig = NULL; NR_CellGroupConfig_t *cellGroupConfig = NULL;
...@@ -3721,12 +3729,13 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch ...@@ -3721,12 +3729,13 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch
static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, const char *msg_name, instance_t instance){ static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, const char *msg_name, instance_t instance){
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(msg_p); f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(msg_p);
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt = {
ctxt.rnti = resp->rnti; .rnti = resp->rnti,
ctxt.module_id = instance; .module_id = instance,
ctxt.instance = instance; .instance = instance,
ctxt.enb_flag = 1; .enb_flag = 1,
ctxt.eNB_index = instance; .eNB_index = instance
};
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id]; gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(rrc, ctxt.rnti); struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(rrc, ctxt.rnti);
NR_CellGroupConfig_t *cellGroupConfig = NULL; NR_CellGroupConfig_t *cellGroupConfig = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment