From a72a659fdf22e95e085a5d7d811a841ca44c7858 Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 1 Mar 2021 19:57:46 +0000 Subject: [PATCH] fix timers interface to avoid accessing to a timer after its release. fix gtpu tunnel activation during s1 handover --- lib/include/srslte/common/timers.h | 2 -- srsenb/src/stack/rrc/rrc_mobility.cc | 5 +++-- srsenb/src/stack/upper/gtpu.cc | 4 ++++ srsue/src/stack/rrc/rrc_meas.cc | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/include/srslte/common/timers.h b/lib/include/srslte/common/timers.h index 118f581a7..4daf016fb 100644 --- a/lib/include/srslte/common/timers.h +++ b/lib/include/srslte/common/timers.h @@ -180,8 +180,6 @@ public: void stop() { impl()->stop(); } - void clear() { impl()->clear(); } - void release() { impl()->clear(); diff --git a/srsenb/src/stack/rrc/rrc_mobility.cc b/srsenb/src/stack/rrc/rrc_mobility.cc index 4b2e34c32..5ab3dd47b 100644 --- a/srsenb/src/stack/rrc/rrc_mobility.cc +++ b/srsenb/src/stack/rrc/rrc_mobility.cc @@ -742,6 +742,7 @@ void rrc::ue::rrc_mobility::handle_ho_requested(idle_st& s, const ho_req_rx_ev& // Set admitted E-RABs std::vector admitted_erabs; auto& fwd_tunnels = get_state()->pending_tunnels; + fwd_tunnels.clear(); for (auto& erab : rrc_ue->bearer_list.get_erabs()) { admitted_erabs.emplace_back(); asn1::s1ap::erab_admitted_item_s& admitted_erab = admitted_erabs.back(); @@ -907,8 +908,8 @@ void rrc::ue::rrc_mobility::handle_status_transfer(s1_target_ho_st& s, const sta } // Enable forwarding of GTPU SDUs to PDCP - for (uint32_t teid : s.pending_tunnels) { - rrc_enb->gtpu->set_tunnel_status(teid, true); + for (auto& erab : rrc_ue->bearer_list.get_erabs()) { + rrc_enb->gtpu->set_tunnel_status(erab.second.teid_in, true); } // Check if there is any pending Reconfiguration Complete. If there is, self-trigger diff --git a/srsenb/src/stack/upper/gtpu.cc b/srsenb/src/stack/upper/gtpu.cc index 62891d69c..6880a1cd9 100644 --- a/srsenb/src/stack/upper/gtpu.cc +++ b/srsenb/src/stack/upper/gtpu.cc @@ -191,6 +191,10 @@ void gtpu::set_tunnel_status(uint32_t teidin, bool dl_active) } tun_it->second.dl_enabled = dl_active; if (dl_active) { + logger.info("Activing GTPU tunnel rnti=0x%x,TEID=%d. %d SDUs currently buffered", + tun_it->second.rnti, + teidin, + tun_it->second.buffer.size()); for (auto& sdu_it : tun_it->second.buffer) { pdcp->write_sdu(tun_it->second.rnti, tun_it->second.lcid, diff --git a/srsue/src/stack/rrc/rrc_meas.cc b/srsue/src/stack/rrc/rrc_meas.cc index 7cf12ada9..b8641ca04 100644 --- a/srsue/src/stack/rrc/rrc_meas.cc +++ b/srsue/src/stack/rrc/rrc_meas.cc @@ -335,7 +335,7 @@ void rrc::rrc_meas::var_meas_report_list::generate_report_eutra(meas_results_s* } } else { if (var_meas.periodic_timer.is_valid()) { - var_meas.periodic_timer.clear(); + var_meas.periodic_timer.stop(); } // else if the triggerType is set to ‘periodical’: if (var_meas.report_cfg_eutra.trigger_type.type().value == report_cfg_eutra_s::trigger_type_c_::types::periodical) { @@ -415,7 +415,7 @@ void rrc::rrc_meas::var_meas_report_list::generate_report_interrat(meas_results_ } } else { if (var_meas.periodic_timer.is_valid()) { - var_meas.periodic_timer.clear(); + var_meas.periodic_timer.stop(); } // else if the triggerType is set to ‘periodical’: if (var_meas.report_cfg_inter.trigger_type.type().value ==