From 8ae0b9bc0534f154c5c0aa7bdcc80e0e40c1090d Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Tue, 5 Sep 2023 12:07:37 +0200 Subject: [PATCH] mac: fix handling of the logical channel group priority in the srsue --- srsue/src/stack/mac_nr/proc_bsr_nr.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/srsue/src/stack/mac_nr/proc_bsr_nr.cc b/srsue/src/stack/mac_nr/proc_bsr_nr.cc index 753ff8f38..70e40e5b5 100644 --- a/srsue/src/stack/mac_nr/proc_bsr_nr.cc +++ b/srsue/src/stack/mac_nr/proc_bsr_nr.cc @@ -247,13 +247,14 @@ int proc_bsr_nr::setup_lcid(uint32_t lcid, uint32_t new_lcg, uint32_t priority) std::lock_guard lock(mutex); // Check that the new priority doesn't not already exist - if (lcg_priorities.find(priority) != lcg_priorities.end()) { + auto it = lcg_priorities.find(priority); + if (it != lcg_priorities.end() and *it != new_lcg) { logger.error( - "BSR: Invalid config. Priority=%d already configured for lcg=%d", priority, lcg_priorities.at(priority)); + "BSR: Invalid config. Priority=%d already configured for lcg=%d", priority, *it); return SRSRAN_ERROR; } - lcg_priorities[priority] = new_lcg; + *it = new_lcg; return SRSRAN_SUCCESS; }