fix handling of CRNTI CE in the RRC. The scheduler should not allocate more grants for the new rnti after this point.

This commit is contained in:
Francisco 2021-05-21 15:14:23 +01:00 committed by Ismael Gomez
parent 59513c0eed
commit 8811b7c9a7
2 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -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();