diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue.h index a776ca62b..236dc0cb7 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue.h @@ -46,6 +46,7 @@ public: void activity_timer_expired(const activity_timeout_type_t type); void rlf_timer_expired(uint32_t timeout_id); void max_rlc_retx_reached(); + void deactivate_bearers() { mac_ctrl.set_radio_bearer_state(sched_interface::ue_bearer_cfg_t::IDLE); } rrc_state_t get_state(); void get_metrics(rrc_ue_metrics_t& ue_metrics) const; diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index c9144c88b..164a747d5 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -222,12 +222,16 @@ int rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) void rrc::upd_user(uint16_t new_rnti, uint16_t old_rnti) { // Remove new_rnti - rem_user_thread(new_rnti); + auto new_ue_it = users.find(new_rnti); + if (new_ue_it != users.end()) { + new_ue_it->second->deactivate_bearers(); + rem_user_thread(new_rnti); + } // Send Reconfiguration to old_rnti if is RRC_CONNECT or RRC Release if already released here auto old_it = users.find(old_rnti); if (old_it == users.end()) { - send_rrc_connection_reject(old_rnti); + logger.info("rnti=0x%x received MAC CRNTI CE: 0x%x, but old context is unavailable", new_rnti, old_rnti); return; } ue* ue_ptr = old_it->second.get();