From c24b25f42edbd3029bcf49235dcb4f91a468d754 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 17 Oct 2019 16:01:59 +0200 Subject: [PATCH] after RLF store PCI of current serving cell the PCI is needed for the reestablishment request in case the new serving cell has changed --- srsue/hdr/stack/rrc/rrc.h | 1 + srsue/src/stack/rrc/rrc.cc | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index d5399a60c..76f0cb2d7 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -468,6 +468,7 @@ private: bool initiated = false; asn1::rrc::reest_cause_e m_reest_cause = asn1::rrc::reest_cause_e::nulltype; uint16_t m_reest_rnti = 0; + uint16_t m_reest_source_pci = 0; bool reestablishment_started = false; bool reestablishment_successful = false; diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index e1c57fd7e..30b727eee 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -880,6 +880,11 @@ void rrc::send_con_restablish_request() crnti = ho_src_rnti; pci = ho_src_cell.get_pci(); cellid = ho_src_cell.get_cell_id(); + } else if (cause == asn1::rrc::reest_cause_e::other_fail) { + // use source PCI after RLF + crnti = m_reest_rnti; + pci = m_reest_source_pci; + cellid = serving_cell->get_cell_id(); } else { crnti = m_reest_rnti; pci = serving_cell->get_pci(); @@ -887,8 +892,7 @@ void rrc::send_con_restablish_request() } // Compute shortMAC-I - uint8_t varShortMAC_packed[16]; - bzero(varShortMAC_packed, 16); + uint8_t varShortMAC_packed[16] = {}; asn1::bit_ref bref(varShortMAC_packed, sizeof(varShortMAC_packed)); // ASN.1 encode VarShortMAC-Input @@ -1347,6 +1351,8 @@ void rrc::init_con_restablish_request(asn1::rrc::reest_cause_e cause) // Save reestablishment cause and current C-RNTI m_reest_rnti = uernti.crnti; m_reest_cause = cause; + m_reest_source_pci = serving_cell->get_pci(); // needed for reestablishment with another cell + reestablishment_started = false; // initiation of reestablishment procedure as indicates in 3GPP 36.331 Section 5.3.7.2