drop PDCP SDU that do not pass integrity check

This commit is contained in:
Andre Puschmann 2018-08-06 15:58:51 +02:00
parent 716b028023
commit 8a869d83f2
1 changed files with 6 additions and 2 deletions

View File

@ -214,10 +214,13 @@ void pdcp_entity::write_pdu(byte_buffer_t *pdu)
} }
if (do_integrity) { if (do_integrity) {
integrity_verify(pdu->msg, if (not integrity_verify(pdu->msg,
rx_count, rx_count,
pdu->N_bytes - 4, pdu->N_bytes - 4,
&(pdu->msg[pdu->N_bytes - 4])); &(pdu->msg[pdu->N_bytes - 4]))) {
log->error_hex(pdu->msg, pdu->N_bytes, "RX %s PDU SN: %d", rrc->get_rb_name(lcid).c_str(), sn);
goto exit;
}
} }
pdcp_unpack_control_pdu(pdu, &sn); pdcp_unpack_control_pdu(pdu, &sn);
@ -226,6 +229,7 @@ void pdcp_entity::write_pdu(byte_buffer_t *pdu)
// pass to RRC // pass to RRC
rrc->write_pdu(lcid, pdu); rrc->write_pdu(lcid, pdu);
} }
exit:
rx_count++; rx_count++;
} }