rlc_am_lte: add some more sanity checks around retx of PDUs

this patch doesn't change any functionality but adds a bit
of further error checking around the handling of status PDUs
and the retx of PDUs
master
Andre Puschmann 4 years ago
parent 6d9709fe54
commit 1b1cfa40c9

@ -535,7 +535,16 @@ void rlc_am_lte::rlc_am_lte_tx::timer_expired(uint32_t timeout_id)
void rlc_am_lte::rlc_am_lte_tx::retransmit_pdu() void rlc_am_lte::rlc_am_lte_tx::retransmit_pdu()
{ {
if (not tx_window.empty()) { if (tx_window.empty()) {
logger.warning("%s No PDU to retransmit.", RB_NAME);
return;
}
if (not tx_window.has_sn(vt_a)) {
logger.warning("%s Can't retransmit unexisting SN=%d.", RB_NAME, vt_a);
return;
}
// select first PDU in tx window for retransmission // select first PDU in tx window for retransmission
rlc_amd_tx_pdu_t& pdu = tx_window[vt_a]; rlc_amd_tx_pdu_t& pdu = tx_window[vt_a];
logger.info("%s Schedule SN=%d for reTx.", RB_NAME, pdu.rlc_sn); logger.info("%s Schedule SN=%d for reTx.", RB_NAME, pdu.rlc_sn);
@ -545,7 +554,6 @@ void rlc_am_lte::rlc_am_lte_tx::retransmit_pdu()
retx.so_end = pdu.buf->N_bytes; retx.so_end = pdu.buf->N_bytes;
retx.sn = pdu.rlc_sn; retx.sn = pdu.rlc_sn;
} }
}
/**************************************************************************** /****************************************************************************
* Helper functions * Helper functions
@ -1186,6 +1194,11 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no
i = (i + 1) % MOD; i = (i + 1) % MOD;
} }
// Make sure vt_a points to valid SN
if (not tx_window.empty() && not tx_window.has_sn(vt_a)) {
logger.error("%s vt_a=%d points to invalid position in Tx window", RB_NAME, vt_a);
}
if (not notify_info_vec.empty()) { if (not notify_info_vec.empty()) {
// Remove all SDUs that were fully acked // Remove all SDUs that were fully acked
for (uint32_t acked_pdcp_sn : notify_info_vec) { for (uint32_t acked_pdcp_sn : notify_info_vec) {

Loading…
Cancel
Save