Commit 6ec545e2 authored by Melissa Elkadi's avatar Melissa Elkadi

Error checking for processing DL PDUs

Also, we only should be handling/generating AM
PDUs in the PDCP/RLC layer, not UM PDUs. Updated
the pre-configuration settings. This seemed to
make the uplink traffic work (meaning it gets
from NR UE to the gNB to the EPC). Woo! Still
working on the downlink.
parent cad11751
...@@ -3334,14 +3334,21 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, ...@@ -3334,14 +3334,21 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
// check if LCID is valid at current time. // check if LCID is valid at current time.
default: default:
{
// check if LCID is valid at current time. // check if LCID is valid at current time.
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
return;
NR_MAC_SUBHEADER_SHORT *shs = (NR_MAC_SUBHEADER_SHORT *)pduP;
if (shs->F) {
//mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; //mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
mac_subheader_len = 3; mac_subheader_len = 3;
mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG))
| ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff); return;
NR_MAC_SUBHEADER_LONG *shl = (NR_MAC_SUBHEADER_LONG *)pduP;
mac_sdu_len = ((uint16_t)(shl->L1 & 0x7f) << 8) | (uint16_t)(shl->L2 & 0xff);
} else { } else {
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
return;
mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
mac_subheader_len = 2; mac_subheader_len = 2;
} }
...@@ -3377,6 +3384,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, ...@@ -3377,6 +3384,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
break; break;
} }
}
pduP += ( mac_subheader_len + mac_ce_len + mac_sdu_len ); pduP += ( mac_subheader_len + mac_ce_len + mac_sdu_len );
pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len ); pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len );
if (pdu_len < 0) if (pdu_len < 0)
......
...@@ -1023,7 +1023,7 @@ void nr_DRB_preconfiguration(uint16_t crnti) ...@@ -1023,7 +1023,7 @@ void nr_DRB_preconfiguration(uint16_t crnti)
NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig)); NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
nr_rlc_bearer_init(RLC_BearerConfig,NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity); nr_rlc_bearer_init(RLC_BearerConfig,NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity);
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional); nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig); nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig);
Rlc_Bearer_ToAdd_list = calloc(1,sizeof(*Rlc_Bearer_ToAdd_list)); Rlc_Bearer_ToAdd_list = calloc(1,sizeof(*Rlc_Bearer_ToAdd_list));
......
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