From 5b025cfbf8ec78474896231f266ba8970128e512 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 27 Oct 2021 15:51:36 +0200 Subject: [PATCH] rlc_um_nr: reimplement update of RX_Next_Reassembly --- lib/src/rlc/rlc_um_nr.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/src/rlc/rlc_um_nr.cc b/lib/src/rlc/rlc_um_nr.cc index 4bb959c67..610821d4b 100644 --- a/lib/src/rlc/rlc_um_nr.cc +++ b/lib/src/rlc/rlc_um_nr.cc @@ -421,9 +421,12 @@ void rlc_um_nr::rlc_um_nr_rx::handle_rx_buffer_update(const uint32_t sn) // find next SN in rx buffer if (sn == RX_Next_Reassembly) { - RX_Next_Reassembly = ((RX_Next_Reassembly + 1) % mod); - while (RX_MOD_NR_BASE(RX_Next_Reassembly) < RX_MOD_NR_BASE(RX_Next_Highest)) { - RX_Next_Reassembly = (RX_Next_Reassembly + 1) % mod; + for (auto it = rx_window.begin(); it != rx_window.end(); ++it) { + logger.debug("SN=%d has %zd segments", it->first, it->second.segments.size()); + if (RX_MOD_NR_BASE(it->first) > RX_MOD_NR_BASE(RX_Next_Reassembly)) { + RX_Next_Reassembly = it->first; + break; + } } logger.debug("Updating RX_Next_Reassembly=%d", RX_Next_Reassembly); }