From 0ad0e9acac2fe3a3d10e4a4658984708d005e932 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 17 Dec 2020 20:24:34 +0000 Subject: [PATCH] Make sure that RLC entity is only re-created if it switches modes. --- lib/src/upper/rlc.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/upper/rlc.cc b/lib/src/upper/rlc.cc index 188cb94b0..e7a6890d4 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/upper/rlc.cc @@ -392,8 +392,10 @@ void rlc::add_bearer(uint32_t lcid, const rlc_config_t& cnfg) rlc_common* rlc_entity = nullptr; if (cnfg.rlc_mode != rlc_mode_t::tm and rlc_array.find(lcid) != rlc_array.end()) { - // RLC entity already exists. Recreating it. - rlc_array.erase(lcid); + if (rlc_array[lcid]->get_mode() != cnfg.rlc_mode) { + rlc_log->info("Switching RLC entity type. Recreating it.\n"); + rlc_array.erase(lcid); + } } if (not valid_lcid(lcid)) {