From 6054e1229b43862735ab2070c8ea247aa345f315 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 24 Sep 2021 17:37:51 +0200 Subject: [PATCH] enb,rrc,rrc_nr: fix logging when removing user each action should only be logged once --- srsenb/src/stack/rrc/rrc.cc | 8 +++----- srsenb/src/stack/rrc/rrc_nr.cc | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index a9eff4db2..283e76a3b 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -651,11 +651,7 @@ void rrc::rem_user(uint16_t rnti) { auto user_it = users.find(rnti); if (user_it != users.end()) { - srsran::console("Disconnecting rnti=0x%x.\n", rnti); - logger.info("Disconnecting rnti=0x%x.", rnti); - - /* First remove MAC and GTPU to stop processing DL/UL traffic for this user - */ + // First remove MAC and GTPU to stop processing DL/UL traffic for this user mac->ue_rem(rnti); // MAC handles PHY gtpu->rem_user(rnti); @@ -665,6 +661,8 @@ void rrc::rem_user(uint16_t rnti) pdcp->rem_user(rnti); users.erase(rnti); + + srsran::console("Disconnecting rnti=0x%x.\n", rnti); logger.info("Removed user rnti=0x%x", rnti); } else { logger.error("Removing user rnti=0x%x (does not exist)", rnti); diff --git a/srsenb/src/stack/rrc/rrc_nr.cc b/srsenb/src/stack/rrc/rrc_nr.cc index 5ffa439b6..ad3229995 100644 --- a/srsenb/src/stack/rrc/rrc_nr.cc +++ b/srsenb/src/stack/rrc/rrc_nr.cc @@ -16,6 +16,7 @@ #include "srsran/asn1/rrc_nr_utils.h" #include "srsran/common/common_nr.h" #include "srsran/common/phy_cfg_nr_default.h" +#include "srsran/common/standard_streams.h" using namespace asn1::rrc_nr; @@ -162,14 +163,13 @@ void rrc_nr::rem_user(uint16_t rnti) { auto user_it = users.find(rnti); if (user_it != users.end()) { - printf("Disconnecting rnti=0x%x.\n", rnti); - logger.info("Disconnecting rnti=0x%x.", rnti); - /* First remove MAC and GTPU to stop processing DL/UL traffic for this user - */ + // First remove MAC and GTPU to stop processing DL/UL traffic for this user mac->remove_ue(rnti); // MAC handles PHY rlc->rem_user(rnti); pdcp->rem_user(rnti); users.erase(rnti); + + srsran::console("Disconnecting rnti=0x%x.\n", rnti); logger.info("Removed user rnti=0x%x", rnti); } else { logger.error("Removing user rnti=0x%x (does not exist)", rnti);