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());