lib,rlc_am_nr: fixed stack smashing bug that happened when too many NACKs were present in the status report

This commit is contained in:
Pedro Alvarez 2022-02-21 18:09:20 +00:00
parent ddbd857867
commit e6d976d115
2 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,9 @@
namespace srsran {
const uint32_t INVALID_RLC_SN = 0xFFFFFFFF;
const uint32_t RLC_AM_NR_WINDOW_SIZE_12BIT = 4096;
const uint32_t RLC_AM_NR_WINDOW_SIZE_18BIT = 262144;
const uint32_t INVALID_RLC_SN = 0xFFFFFFFF;
///< AM NR PDU header
struct rlc_am_nr_pdu_header_t {
@ -82,7 +84,7 @@ typedef struct {
uint32_t ack_sn; ///< SN of the next not received RLC Data PDU
uint16_t N_nack; ///< number of NACKs
uint8_t nack_range; ///< number of consecutively lost RLC SDUs starting from and including NACK_SN
rlc_status_nack_t nacks[RLC_AM_WINDOW_SIZE];
rlc_status_nack_t nacks[RLC_AM_NR_WINDOW_SIZE_12BIT];
} rlc_am_nr_status_pdu_t;
/****************************************************************************

View File

@ -1149,7 +1149,7 @@ uint32_t rlc_am_nr_rx::get_status_pdu(rlc_am_nr_status_pdu_t* status, uint32_t m
{
std::unique_lock<std::mutex> lock(mutex, std::try_to_lock);
if (not lock.owns_lock()) {
return SRSRAN_ERROR;
return 0;
}
status->N_nack = 0;