Commit b2b3f383 authored by rmagueta's avatar rmagueta

Skip invalid MAC CCCH messages for being processed at both gNB and UE

parent 7c377945
...@@ -1786,18 +1786,27 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, ...@@ -1786,18 +1786,27 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
mac_subheader_len = 2; mac_subheader_len = 2;
} }
if ( pdu_len >= (mac_subheader_len + mac_sdu_len) ) { // Check if it is a valid CCCH message, we get all 00's messages very often
int i = 0;
LOG_D(NR_MAC,"DL_SCH_LCID_CCCH with payload len %d\n", mac_sdu_len); for(i=0; i<(mac_subheader_len+mac_sdu_len); i++) {
if(pduP[i] != 0) {
break;
}
}
if (i == (mac_subheader_len+mac_sdu_len)) {
LOG_D(NR_MAC, "%s() Invalid CCCH message!, pdu_len: %d\n", __func__, pdu_len);
done = 1;
break;
}
LOG_D(NR_MAC,"RRCSetup received at nr_ue_process_mac_pdu with payload len %d: \n", mac_sdu_len); if ( mac_sdu_len > 0 ) {
LOG_D(NR_MAC,"DL_SCH_LCID_CCCH (e.g. RRCSetup) with payload len %d\n", mac_sdu_len);
for (int i = 0; i < mac_subheader_len; i++) { for (int i = 0; i < mac_subheader_len; i++) {
LOG_D(NR_MAC, "MAC header %d: 0x%x\n", i, pduP[i]); LOG_D(NR_MAC, "MAC header %d: 0x%x\n", i, pduP[i]);
} }
for (int i = 0; i < mac_sdu_len; i++) { for (int i = 0; i < mac_sdu_len; i++) {
LOG_D(NR_MAC, "%d: 0x%x\n", i, pduP[mac_subheader_len + i]); LOG_D(NR_MAC, "%d: 0x%x\n", i, pduP[mac_subheader_len + i]);
} }
nr_mac_rrc_data_ind_ue(module_idP, CC_id, gNB_index, frameP, 0, mac->crnti, CCCH, pduP+mac_subheader_len, mac_sdu_len); nr_mac_rrc_data_ind_ue(module_idP, CC_id, gNB_index, frameP, 0, mac->crnti, CCCH, pduP+mac_subheader_len, mac_sdu_len);
} }
break; break;
......
...@@ -248,9 +248,16 @@ void nr_process_mac_pdu( ...@@ -248,9 +248,16 @@ void nr_process_mac_pdu(
mac_sdu_len = 8; mac_sdu_len = 8;
// Check if it is a valid CCCH1 message, we get all 00's messages very often // Check if it is a valid CCCH1 message, we get all 00's messages very often
if (pdu_len != 9) { int i = 0;
for(i=0; i<(mac_subheader_len+mac_sdu_len); i++) {
if(pdu_ptr[i] != 0) {
break;
}
}
if (i == (mac_subheader_len+mac_sdu_len)) {
LOG_D(NR_MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len); LOG_D(NR_MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len);
return; done = 1;
break;
} }
} else { } else {
// fixed length of 6 bytes // fixed length of 6 bytes
......
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