lib,rlc_am_nr: fix unprotected access to rx_window during timer expiration

master
Pedro Alvarez 3 years ago
parent a15b4c039e
commit 46872a8c84

@ -1415,20 +1415,22 @@ void rlc_am_nr_rx::timer_expired(uint32_t timeout_id)
* - start t-Reassembly; * - start t-Reassembly;
* - set RX_Next_Status_Trigger to RX_Next_Highest. * - set RX_Next_Status_Trigger to RX_Next_Highest.
*/ */
for (uint32_t tmp_sn = st.rx_next_status_trigger; for (uint32_t sn = st.rx_next_status_trigger; rx_mod_base_nr(sn) <= rx_mod_base_nr(st.rx_next_highest);
tmp_sn < st.rx_next_status_trigger + am_window_size(cfg.rx_sn_field_length); sn = (sn + 1) % mod_nr) {
tmp_sn++) { if (not rx_window->has_sn(sn) || (rx_window->has_sn(sn) && not(*rx_window)[sn].fully_received)) {
if (not rx_window->has_sn(tmp_sn) || not(*rx_window)[tmp_sn].fully_received) { st.rx_highest_status = sn;
st.rx_highest_status = tmp_sn;
break; break;
} }
} }
bool restart_reassembly_timer = false; bool restart_reassembly_timer = false;
if (st.rx_next_highest > st.rx_highest_status + 1) { if (rx_mod_base_nr(st.rx_next_highest) > rx_mod_base_nr(st.rx_highest_status + 1)) {
restart_reassembly_timer = true; restart_reassembly_timer = true;
} }
if (st.rx_next_highest == st.rx_highest_status + 1 && not(*rx_window)[st.rx_next_highest].fully_received) { if (rx_mod_base_nr(st.rx_next_highest) == rx_mod_base_nr(st.rx_highest_status + 1)) {
restart_reassembly_timer = true; if (not rx_window->has_sn(st.rx_next_highest) ||
(rx_window->has_sn(st.rx_next_highest) && not(*rx_window)[st.rx_next_highest].fully_received)) {
restart_reassembly_timer = true;
}
} }
if (restart_reassembly_timer) { if (restart_reassembly_timer) {
reassembly_timer.run(); reassembly_timer.run();

Loading…
Cancel
Save