From 13a5bfb525b4a88cfc00364873cebf06c81f7b53 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 18 Sep 2020 14:34:20 +0200 Subject: [PATCH] - fix reestablishment reject transmission in the srsenb. For SRB0 SDUs, no RLC header is required, so we do not need to check in such case if there is enough space in the TB for the header. - fix srsenb reestablishment check for UE context. The pci has to be accounted for the srsenb to understand that the UE trying to do reestablishment corresponds to one of its own --- srsenb/src/stack/mac/ue.cc | 7 ++++--- srsenb/src/stack/rrc/rrc_ue.cc | 9 +++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index 6287140a4..464cb4593 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -401,12 +401,13 @@ int ue::read_pdu(uint32_t lcid, uint8_t* payload, uint32_t requested_bytes) void ue::allocate_sdu(srslte::sch_pdu* pdu, uint32_t lcid, uint32_t total_sdu_len) { - int sdu_space = pdu->get_sdu_space(); + const int min_sdu_len = lcid == 0 ? 1 : 2; + int sdu_space = pdu->get_sdu_space(); if (sdu_space > 0) { int sdu_len = SRSLTE_MIN(total_sdu_len, (uint32_t)sdu_space); int n = 1; - while (sdu_len >= 2 && n > 0) { // minimum size is a single RLC AM status PDU (2 Byte) - if (pdu->new_subh()) { // there is space for a new subheader + while (sdu_len >= min_sdu_len && n > 0) { // minimum size is a single RLC AM status PDU (2 Byte) + if (pdu->new_subh()) { // there is space for a new subheader log_h->debug("SDU: set_sdu(), lcid=%d, sdu_len=%d, sdu_space=%d\n", lcid, sdu_len, sdu_space); n = pdu->get()->set_sdu(lcid, sdu_len, this); if (n > 0) { // new SDU could be added diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index 8d7c6b96d..05e1cada3 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -331,8 +331,13 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg) (uint32_t)msg->crit_exts.rrc_conn_reest_request_r8().ue_id.short_mac_i.to_number(), msg->crit_exts.rrc_conn_reest_request_r8().reest_cause.to_string().c_str()); if (is_idle()) { - uint16_t old_rnti = msg->crit_exts.rrc_conn_reest_request_r8().ue_id.c_rnti.to_number(); - if (parent->users.count(old_rnti)) { + uint16_t old_rnti = msg->crit_exts.rrc_conn_reest_request_r8().ue_id.c_rnti.to_number(); + uint16_t old_pci = msg->crit_exts.rrc_conn_reest_request_r8().ue_id.pci; + const cell_info_common* old_cell = parent->cell_common_list->get_pci(old_pci); + auto ue_it = parent->users.find(old_rnti); + // Reject unrecognized rntis, and PCIs that do not belong to eNB + if (ue_it != parent->users.end() and old_cell != nullptr and + ue_it->second->cell_ded_list.get_enb_cc_idx(old_cell->enb_cc_idx) != nullptr) { parent->rrc_log->info("ConnectionReestablishmentRequest for rnti=0x%x. Sending Connection Reestablishment\n", old_rnti); send_connection_reest(parent->users[old_rnti]->ue_security_cfg.get_ncc());