Commit 8c55ccc9 authored by Laurent THOMAS's avatar Laurent THOMAS

Fix a critical bug introduced by F1-U in 4G

parent 32ebb876
...@@ -1546,7 +1546,7 @@ void pdcp_add_UE(const protocol_ctxt_t *const ctxt_pP) { ...@@ -1546,7 +1546,7 @@ void pdcp_add_UE(const protocol_ctxt_t *const ctxt_pP) {
pdcp_enb[ctxt_pP->module_id].rnti[i]=ctxt_pP->rnti; pdcp_enb[ctxt_pP->module_id].rnti[i]=ctxt_pP->rnti;
pdcp_enb[ctxt_pP->module_id].uid[i]=i; pdcp_enb[ctxt_pP->module_id].uid[i]=i;
pdcp_enb[ctxt_pP->module_id].num_ues++; pdcp_enb[ctxt_pP->module_id].num_ues++;
printf("add new uid is %d %x\n\n", i, ctxt_pP->rnti); LOG_I(PDCP,"add new uid is %d %x\n", i, ctxt_pP->rnti);
pdcp_init_stats_UE(ctxt_pP->module_id, i); pdcp_init_stats_UE(ctxt_pP->module_id, i);
// ret=1; // ret=1;
break; break;
......
...@@ -418,29 +418,31 @@ rb_found: ...@@ -418,29 +418,31 @@ rb_found:
AssertFatal(type != ngran_eNB_CU && type != ngran_ng_eNB_CU && type != ngran_gNB_CU, AssertFatal(type != ngran_eNB_CU && type != ngran_ng_eNB_CU && type != ngran_gNB_CU,
"Can't be CU, bad node type %d\n", type); "Can't be CU, bad node type %d\n", type);
if (NODE_IS_DU(type) && is_srb == 1) { if (NODE_IS_DU(type)) {
MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE, sizeof(*msg) + size); if (is_srb == 1) {
F1AP_UL_RRC_MESSAGE(msg).rrc_container = (uint8_t*)(msg+1); MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE, sizeof(*msg) + size);
memcpy(F1AP_UL_RRC_MESSAGE(msg).rrc_container, buf, size); F1AP_UL_RRC_MESSAGE(msg).rrc_container = (uint8_t*)(msg+1);
F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti; memcpy(F1AP_UL_RRC_MESSAGE(msg).rrc_container, buf, size);
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id; F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti;
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size; F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id;
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg); F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size;
return; itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg);
} else { return;
// Fixme: very dirty workaround of incomplete F1-U implementation } else {
instance_t DUuniqInstance=0; // Fixme: very dirty workaround of incomplete F1-U implementation
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ); instance_t DUuniqInstance=0;
gtpv1u_enb_tunnel_data_req_t *req=&GTPV1U_ENB_TUNNEL_DATA_REQ(msg); MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ);
req->buffer=malloc(size); gtpv1u_enb_tunnel_data_req_t *req=&GTPV1U_ENB_TUNNEL_DATA_REQ(msg);
memcpy(req->buffer,buf,size); req->buffer=malloc(size);
req->length=size; memcpy(req->buffer,buf,size);
req->offset=0; req->length=size;
req->rnti=ue->rnti; req->offset=0;
req->rab_id=rb_id+4; req->rnti=ue->rnti;
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); req->rab_id=rb_id+4;
itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg); LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
return; itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg);
return;
}
} }
} }
......
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