From 5181d07c8a7b62de9cb6f21862edcc6223bf1b0b Mon Sep 17 00:00:00 2001 From: yagoda Date: Fri, 11 Mar 2022 00:04:11 +0100 Subject: [PATCH] mac: fixing pdcch order bug, dont send if rnti is not in ue_db --- srsenb/src/stack/mac/mac.cc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index b3cf9e407..e56f0e879 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -776,17 +776,20 @@ int mac::get_dl_sched(uint32_t tti_tx_dl, dl_sched_list_t& dl_sched_res_list) // Copy PDCCH order grants for (uint32_t i = 0; i < sched_result.po.size(); i++) { - // Copy dci info - dl_sched_res->pdsch[n].dci = sched_result.po[i].dci; - - if (pcap) { - pcap->write_dl_pch(dl_sched_res->pdsch[n].data[0], sched_result.po[i].tbs, true, tti_tx_dl, enb_cc_idx); - } - if (pcap_net) { - pcap_net->write_dl_pch(dl_sched_res->pdsch[n].data[0], sched_result.po[i].tbs, true, tti_tx_dl, enb_cc_idx); + uint16_t rnti = sched_result.po[i].dci.rnti; + if (ue_db.contains(rnti)) { + // Copy dci info + dl_sched_res->pdsch[n].dci = sched_result.po[i].dci; + if (pcap) { + pcap->write_dl_pch(dl_sched_res->pdsch[n].data[0], sched_result.po[i].tbs, true, tti_tx_dl, enb_cc_idx); + } + if (pcap_net) { + pcap_net->write_dl_pch(dl_sched_res->pdsch[n].data[0], sched_result.po[i].tbs, true, tti_tx_dl, enb_cc_idx); + } + n++; + } else { + logger.warning("Invalid PDCCH order scheduling result. User 0x%x does not exist", rnti); } - - n++; } dl_sched_res->nof_grants = n;