Fix lte-uesoftmodem: segfaults & logic errors
* prevent segfault: guard access to RC.rrc with UETARGET * in rlc_data_ind(): correct logic to test for all cases eNB, CU, DU, UE
This commit is contained in:
@@ -370,10 +370,10 @@ boolean_t pdcp_data_req(
|
|||||||
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1))
|
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifndef UETARGET
|
||||||
LOG_D(PDCP, "pdcp data req on drb %d, size %d, rnti %x, node_type %d \n",
|
LOG_D(PDCP, "pdcp data req on drb %d, size %d, rnti %x, node_type %d \n",
|
||||||
rb_idP, pdcp_pdu_size, ctxt_pP->rnti, RC.rrc[ctxt_pP->module_id]->node_type);
|
rb_idP, pdcp_pdu_size, ctxt_pP->rnti, RC.rrc[ctxt_pP->module_id]->node_type);
|
||||||
|
|
||||||
#ifndef UETARGET
|
|
||||||
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU
|
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU
|
||||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU
|
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU
|
||||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) {
|
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) {
|
||||||
@@ -428,6 +428,7 @@ boolean_t pdcp_data_req(
|
|||||||
else // SRB
|
else // SRB
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifndef UETARGET
|
||||||
if ((RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU) ||
|
if ((RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU) ||
|
||||||
(RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU)||
|
(RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU)||
|
||||||
(RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) ) {
|
(RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) ) {
|
||||||
@@ -449,7 +450,9 @@ boolean_t pdcp_data_req(
|
|||||||
LOG_I(PDCP, "Send F1AP_DL_RRC_MESSAGE with ITTI\n");
|
LOG_I(PDCP, "Send F1AP_DL_RRC_MESSAGE with ITTI\n");
|
||||||
ret=TRUE;
|
ret=TRUE;
|
||||||
|
|
||||||
} else{
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
rlc_status = rlc_data_req(ctxt_pP
|
rlc_status = rlc_data_req(ctxt_pP
|
||||||
, srb_flagP
|
, srb_flagP
|
||||||
, MBMS_FLAG_NO
|
, MBMS_FLAG_NO
|
||||||
|
|||||||
+19
-40
@@ -607,49 +607,28 @@ void rlc_data_ind (
|
|||||||
T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
|
T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if (ctxt_pP->enb_flag == 1)
|
|
||||||
{
|
|
||||||
switch (RC.rrc[ctxt_pP->module_id]->node_type){
|
|
||||||
case ngran_eNB_CU:
|
|
||||||
case ngran_ng_eNB_CU:
|
|
||||||
case ngran_gNB_CU:
|
|
||||||
LOG_E(RLC, "Can't be CU, Bad Node type %d\n",RC.rrc[ctxt_pP->module_id]->node_type);
|
|
||||||
break;
|
|
||||||
case ngran_eNB_DU:
|
|
||||||
case ngran_gNB_DU:
|
|
||||||
if (srb_flagP == 1) {
|
|
||||||
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, F1AP_UL_RRC_MESSAGE);
|
|
||||||
F1AP_UL_RRC_MESSAGE(msg).rnti = ctxt_pP->rnti;
|
|
||||||
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_idP;
|
|
||||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container = sdu_pP->data;
|
|
||||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = sdu_sizeP;
|
|
||||||
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), msg);
|
|
||||||
}
|
|
||||||
#ifndef UETARGET
|
#ifndef UETARGET
|
||||||
else
|
const ngran_node_t type = RC.rrc[ctxt_pP->module_id]->node_type;
|
||||||
proto_agent_send_pdcp_data_ind (
|
AssertFatal(type != ngran_eNB_CU && type != ngran_ng_eNB_CU && type != ngran_gNB_CU,
|
||||||
ctxt_pP,
|
"Can't be CU, bad node type %d\n", type);
|
||||||
srb_flagP,
|
|
||||||
MBMS_flagP,
|
|
||||||
rb_idP,
|
|
||||||
sdu_sizeP,
|
|
||||||
sdu_pP);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
break;
|
if (type == ngran_eNB_DU || type == ngran_gNB_DU) {
|
||||||
|
if (srb_flagP == 1) {
|
||||||
default:
|
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, F1AP_UL_RRC_MESSAGE);
|
||||||
pdcp_data_ind (
|
F1AP_UL_RRC_MESSAGE(msg).rnti = ctxt_pP->rnti;
|
||||||
ctxt_pP,
|
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_idP;
|
||||||
srb_flagP,
|
F1AP_UL_RRC_MESSAGE(msg).rrc_container = sdu_pP->data;
|
||||||
MBMS_flagP,
|
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = sdu_sizeP;
|
||||||
rb_idP,
|
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), msg);
|
||||||
sdu_sizeP,
|
} else {
|
||||||
sdu_pP);
|
proto_agent_send_pdcp_data_ind (ctxt_pP, srb_flagP, MBMS_flagP, rb_idP, sdu_sizeP, sdu_pP);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
}
|
#endif
|
||||||
|
{ // case monolithic eNodeB or UE
|
||||||
|
pdcp_data_ind(ctxt_pP, srb_flagP, MBMS_flagP, rb_idP, sdu_sizeP, sdu_pP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void rlc_data_conf (const protocol_ctxt_t *const ctxt_pP,
|
void rlc_data_conf (const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
|||||||
Reference in New Issue
Block a user