diff --git a/lib/include/srsran/rlc/rlc_am_lte.h b/lib/include/srsran/rlc/rlc_am_lte.h index 4de710f38..9066f3236 100644 --- a/lib/include/srsran/rlc/rlc_am_lte.h +++ b/lib/include/srsran/rlc/rlc_am_lte.h @@ -484,7 +484,6 @@ private: int get_status_pdu_length(); int get_status_pdu(rlc_status_pdu_t* status, const uint32_t nof_bytes); bool get_do_status(); - void reset_status(); // called when status PDU has been sent private: void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes, rlc_amd_pdu_header_t& header); @@ -494,6 +493,7 @@ private: void debug_state(); void print_rx_segments(); bool add_segment_and_check(rlc_amd_rx_pdu_segments_t* pdu, rlc_amd_rx_pdu* segment); + void reset_status(); rlc_am_lte* parent = nullptr; byte_buffer_pool* pool = nullptr; diff --git a/lib/src/rlc/rlc_am_lte.cc b/lib/src/rlc/rlc_am_lte.cc index c0848e5a8..6cc8ab07a 100644 --- a/lib/src/rlc/rlc_am_lte.cc +++ b/lib/src/rlc/rlc_am_lte.cc @@ -671,9 +671,6 @@ int rlc_am_lte::rlc_am_lte_tx::build_status_pdu(uint8_t* payload, uint32_t nof_b pdu_len = 0; } else if (pdu_len > 0 && nof_bytes >= static_cast(pdu_len)) { log_rlc_am_status_pdu_to_string(logger.info, "%s Tx status PDU - %s", &tx_status, RB_NAME); - - parent->rx.reset_status(); - if (cfg.t_status_prohibit > 0 && status_prohibit_timer.is_valid()) { // re-arm timer status_prohibit_timer.run(); @@ -1845,7 +1842,6 @@ void rlc_am_lte::rlc_am_lte_rx::reassemble_rx_sdus() void rlc_am_lte::rlc_am_lte_rx::reset_status() { - std::lock_guard lock(mutex); do_status = false; poll_received = false; } @@ -1970,6 +1966,9 @@ int rlc_am_lte::rlc_am_lte_rx::get_status_pdu(rlc_status_pdu_t* status, const ui i = (i + 1) % MOD; } + // valid PDU could be generated + reset_status(); + return rlc_am_packed_length(status); }