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,16 +535,24 @@ 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()) {
// select first PDU in tx window for retransmission logger.warning("%s No PDU to retransmit.", RB_NAME);
rlc_amd_tx_pdu_t& pdu = tx_window[vt_a]; return;
logger.info("%s Schedule SN=%d for reTx.", RB_NAME, pdu.rlc_sn); }
rlc_amd_retx_t& retx = retx_queue.push();
retx.is_segment = false; if (not tx_window.has_sn(vt_a)) {
retx.so_start = 0; logger.warning("%s Can't retransmit unexisting SN=%d.", RB_NAME, vt_a);
retx.so_end = pdu.buf->N_bytes; return;
retx.sn = pdu.rlc_sn;
} }
// select first PDU in tx window for retransmission
rlc_amd_tx_pdu_t& pdu = tx_window[vt_a];
logger.info("%s Schedule SN=%d for reTx.", RB_NAME, pdu.rlc_sn);
rlc_amd_retx_t& retx = retx_queue.push();
retx.is_segment = false;
retx.so_start = 0;
retx.so_end = pdu.buf->N_bytes;
retx.sn = pdu.rlc_sn;
} }
/**************************************************************************** /****************************************************************************
@ -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