diff --git a/lib/include/srsran/asn1/asn1_utils.h b/lib/include/srsran/asn1/asn1_utils.h index 13f17d8f3..5065097ee 100644 --- a/lib/include/srsran/asn1/asn1_utils.h +++ b/lib/include/srsran/asn1/asn1_utils.h @@ -299,6 +299,7 @@ public: return size() == other.size() and std::equal(data_, data_ + size(), other.data_); } void resize(uint32_t new_size) { current_size = new_size; } + void clear() { resize(0); } void push_back(const T& elem) { if (current_size >= MAX_N) { diff --git a/srsgnb/src/stack/rrc/cell_asn1_config.cc b/srsgnb/src/stack/rrc/cell_asn1_config.cc index 09257c543..d80c76073 100644 --- a/srsgnb/src/stack/rrc/cell_asn1_config.cc +++ b/srsgnb/src/stack/rrc/cell_asn1_config.cc @@ -1141,6 +1141,9 @@ void fill_cellgroup_with_radio_bearer_cfg(const rrc_nr_cfg_t& const asn1::rrc_nr::radio_bearer_cfg_s& bearers, asn1::rrc_nr::cell_group_cfg_s& out) { + out.rlc_bearer_to_add_mod_list.clear(); + out.rlc_bearer_to_release_list.clear(); + // Add SRBs for (const srb_to_add_mod_s& srb : bearers.srb_to_add_mod_list) { out.rlc_bearer_to_add_mod_list.push_back({}); diff --git a/srsgnb/src/stack/rrc/rrc_nr_ue.cc b/srsgnb/src/stack/rrc/rrc_nr_ue.cc index 652d82d04..f404a98b7 100644 --- a/srsgnb/src/stack/rrc/rrc_nr_ue.cc +++ b/srsgnb/src/stack/rrc/rrc_nr_ue.cc @@ -1199,7 +1199,10 @@ int rrc_nr::ue::update_rlc_bearers(const asn1::rrc_nr::cell_group_cfg_s& cell_gr // Add/Mod RLC radio bearers for (const rlc_bearer_cfg_s& rb : cell_group_diff.rlc_bearer_to_add_mod_list) { srsran::rlc_config_t rlc_cfg; - if (srsran::make_rlc_config_t(rb.rlc_cfg, rb.served_radio_bearer.drb_id(), &rlc_cfg) != SRSRAN_SUCCESS) { + uint8_t rb_id = rb.served_radio_bearer.type().value == rlc_bearer_cfg_s::served_radio_bearer_c_::types_opts::drb_id + ? rb.served_radio_bearer.drb_id() + : rb.served_radio_bearer.srb_id(); + if (srsran::make_rlc_config_t(rb.rlc_cfg, rb_id, &rlc_cfg) != SRSRAN_SUCCESS) { logger.error("Failed to build RLC config"); // TODO: HANDLE return SRSRAN_ERROR;