From abe82d0b7d86a5e7c6837b590632d6a497698d77 Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 21 Feb 2022 10:56:01 +0000 Subject: [PATCH] fix infinite loop that takes place when the UE is being added in the mac but the ue_db is full --- srsenb/src/stack/mac/mac.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 5890bd985..b3cf9e407 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -459,10 +459,6 @@ bool mac::is_valid_rnti_unprotected(uint16_t rnti) logger.info("RACH ignored as eNB is being shutdown"); return false; } - if (ue_db.full()) { - logger.warning("Maximum number of connected UEs %zd connected to the eNB. Ignoring PRACH", SRSENB_MAX_UES); - return false; - } if (not ue_db.has_space(rnti)) { logger.info("Failed to allocate rnti=0x%x. Attempting a different rnti.", rnti); return false; @@ -482,6 +478,10 @@ uint16_t mac::allocate_ue(uint32_t enb_cc_idx) // Pre-check if rnti is valid { srsran::rwlock_read_guard read_lock(rwlock); + if (ue_db.full()) { + logger.warning("Maximum number of connected UEs %zd connected to the eNB. Ignoring PRACH", SRSENB_MAX_UES); + return SRSRAN_INVALID_RNTI; + } if (not is_valid_rnti_unprotected(rnti)) { continue; }