From 0996e50dce22e4e1921c709de63250c376f656b0 Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 25 May 2021 19:25:03 +0100 Subject: [PATCH] bugfix, s1ap: allow source enb to release old UE ctxt in case a connectionRequest arrives with repeated m-TMSI --- srsenb/src/stack/rrc/rrc_ue.cc | 2 +- srsenb/src/stack/s1ap/s1ap.cc | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index ef7fab433..4181a6579 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -392,7 +392,7 @@ void rrc::ue::handle_rrc_con_req(rrc_conn_request_s* msg) if (user.first != rnti && user.second->has_tmsi && user.second->mmec == mmec && user.second->m_tmsi == m_tmsi) { parent->logger.info("RRC connection request: UE context already exists. M-TMSI=%d", m_tmsi); user.second->state = RRC_STATE_IDLE; // Set old rnti to IDLE so that enb doesn't send RRC Connection Release - parent->s1ap->user_release(user.first, asn1::s1ap::cause_radio_network_opts::radio_conn_with_ue_lost); + parent->s1ap->user_release(user.first, asn1::s1ap::cause_radio_network_opts::interaction_with_other_proc); break; } } diff --git a/srsenb/src/stack/s1ap/s1ap.cc b/srsenb/src/stack/s1ap/s1ap.cc index 7cb15c4a6..8f408627c 100644 --- a/srsenb/src/stack/s1ap/s1ap.cc +++ b/srsenb/src/stack/s1ap/s1ap.cc @@ -1402,10 +1402,13 @@ bool s1ap::ue::send_uectxtreleaserequest(const cause_c& cause) return false; } - if (ts1_reloc_overall.is_running()) { + if (ts1_reloc_overall.is_running() and cause.type().value == asn1::s1ap::cause_c::types_opts::radio_network and + (cause.radio_network().value == asn1::s1ap::cause_radio_network_opts::user_inactivity or + cause.radio_network().value == asn1::s1ap::cause_radio_network_opts::radio_conn_with_ue_lost)) { logger.info("Ignoring UE context release request from lower layers for UE rnti=0x%x performing S1 Handover.", ctxt.rnti); - // leave the UE context alive until ts1_reloc_overall expiry + // Leave the UE context alive during S1 Handover until ts1_reloc_overall expiry. Ignore releases due to + // UE inactivity or RLF return false; }