From dcf5a727f2c18189b0f3177a2d387383131a3a2b Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Tue, 22 Sep 2020 15:07:24 +0200 Subject: [PATCH] do not send RRC release in case the eNB receives a S1AP UEContextRelease command and the UE is doing handover. Handle GTPU end marker --- lib/include/srslte/upper/gtpu.h | 2 +- srsenb/src/stack/rrc/rrc.cc | 18 +++++++++++------- srsenb/src/stack/upper/gtpu.cc | 6 ++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/include/srslte/upper/gtpu.h b/lib/include/srslte/upper/gtpu.h index 9ade8d6ce..31daf6966 100644 --- a/lib/include/srslte/upper/gtpu.h +++ b/lib/include/srslte/upper/gtpu.h @@ -106,7 +106,7 @@ inline bool gtpu_supported_msg_type_check(gtpu_header_t* header, srslte::log_ref { // msg_tpye if (header->message_type != GTPU_MSG_DATA_PDU && header->message_type != GTPU_MSG_ECHO_REQUEST && - header->message_type != GTPU_MSG_ECHO_RESPONSE) { + header->message_type != GTPU_MSG_ECHO_RESPONSE && header->message_type != GTPU_MSG_END_MARKER) { gtpu_log->error("gtpu_header - Unhandled message type: 0x%x\n", header->message_type); return false; } diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index ba6a25edf..3aeb3461c 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -538,15 +538,19 @@ void rrc::process_release_complete(uint16_t rnti) { rrc_log->info("Received Release Complete rnti=0x%x\n", rnti); auto user_it = users.find(rnti); - if (user_it != users.end()) { - if (!user_it->second->is_idle()) { - rlc->clear_buffer(rnti); - user_it->second->send_connection_release(); - } + if (user_it == users.end()) { + rrc_log->error("Received ReleaseComplete for unknown rnti=0x%x\n", rnti); + return; + } + ue* u = user_it->second.get(); + + if (u->is_idle() or u->mobility_handler->is_ho_running()) { + rem_user_thread(rnti); + } else if (not u->is_idle()) { + rlc->clear_buffer(rnti); + user_it->second->send_connection_release(); // delay user deletion for ~50 TTI (until RRC release is sent) task_sched.defer_callback(50, [this, rnti]() { rem_user_thread(rnti); }); - } else { - rrc_log->error("Received ReleaseComplete for unknown rnti=0x%x\n", rnti); } } diff --git a/srsenb/src/stack/upper/gtpu.cc b/srsenb/src/stack/upper/gtpu.cc index ef7b8e264..3f82424e4 100644 --- a/srsenb/src/stack/upper/gtpu.cc +++ b/srsenb/src/stack/upper/gtpu.cc @@ -280,6 +280,12 @@ void gtpu::handle_gtpu_s1u_rx_packet(srslte::unique_byte_buffer_t pdu, const soc } pdcp->write_sdu(rnti, lcid, std::move(pdu)); } break; + case GTPU_MSG_END_MARKER: { + rnti_lcid_t rnti_lcid = teidin_to_rntilcid(header.teid); + uint16_t rnti = rnti_lcid.rnti; + gtpu_log->info("Received GTPU End Marker for rnti=0x%x.\n", rnti); + break; + } default: break; }