mirror of https://github.com/PentHertz/srsLTE.git
Check payload length before demux
This commit is contained in:
parent
76ed6fd8d8
commit
8b1ba55eaf
|
@ -165,7 +165,14 @@ void demux::process_sch_pdu(srslte::sch_pdu *pdu_msg)
|
||||||
// Route logical channel
|
// Route logical channel
|
||||||
if (route_pdu) {
|
if (route_pdu) {
|
||||||
Info("Delivering PDU for lcid=%d, %d bytes\n", pdu_msg->get()->get_sdu_lcid(), pdu_msg->get()->get_payload_size());
|
Info("Delivering PDU for lcid=%d, %d bytes\n", pdu_msg->get()->get_sdu_lcid(), pdu_msg->get()->get_payload_size());
|
||||||
rlc->write_pdu(pdu_msg->get()->get_sdu_lcid(), pdu_msg->get()->get_sdu_ptr(), pdu_msg->get()->get_payload_size());
|
if (pdu_msg->get()->get_payload_size() < MAX_PDU_LEN) {
|
||||||
|
rlc->write_pdu(pdu_msg->get()->get_sdu_lcid(), pdu_msg->get()->get_sdu_ptr(), pdu_msg->get()->get_payload_size());
|
||||||
|
} else {
|
||||||
|
char tmp[1024];
|
||||||
|
srslte_vec_sprint_hex(tmp, pdu_msg->get()->get_sdu_ptr(), 32);
|
||||||
|
Error("PDU size %d exceeds maximum PDU buffer size, lcid=%d, hex=[%s]\n",
|
||||||
|
pdu_msg->get()->get_payload_size(), pdu_msg->get()->get_sdu_lcid(), tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Process MAC Control Element
|
// Process MAC Control Element
|
||||||
|
|
Loading…
Reference in New Issue