lte: End check before dereference and handle cell removals

This commit is contained in:
Gabriel Ferreira
2025-01-29 12:54:41 +01:00
parent 72a6bee292
commit 0a91fea676
3 changed files with 6 additions and 17 deletions

View File

@@ -1495,7 +1495,8 @@ CqaFfMacScheduler::DoSchedDlTriggerReq(
}
qos_rb_and_CQI_assigned_to_lc s;
s.cqi_value_for_lc = UeToCQIValue.find(userWithMaximumMetric)->second;
const auto ueToCqiIt = UeToCQIValue.find(userWithMaximumMetric);
s.cqi_value_for_lc = ueToCqiIt != UeToCQIValue.end() ? ueToCqiIt->second : 1;
s.resource_block_index = currentRB;
auto itMap = allocationMapPerRntiPerLCId.find(userWithMaximumMetric.m_rnti);

View File

@@ -736,10 +736,10 @@ LteFfrEnhancedAlgorithm::DoReportDlCqiInfo(
for (uint32_t j = 0; j < dlRbgAvailableMap.size(); j++)
{
uint32_t index = rbgSize * j;
for (uint32_t i = 0; i < rbgSize; i++)
for (uint32_t i = 0; i < rbgSize && index < m_ulBandwidth; i++)
{
index = index + i;
ulRbAvailableMap[index] = dlRbgAvailableMap[j];
index++;
}
}

View File

@@ -2678,13 +2678,7 @@ LteUeRrc::CancelEnteringTrigger(uint8_t measId, uint16_t cellId)
{
NS_ASSERT(it2->measId == measId);
for (auto it3 = it2->concernedCells.begin(); it3 != it2->concernedCells.end(); ++it3)
{
if (*it3 == cellId)
{
it3 = it2->concernedCells.erase(it3);
}
}
it2->concernedCells.remove_if([cellId](auto cell) { return cellId == cell; });
if (it2->concernedCells.empty())
{
@@ -2735,13 +2729,7 @@ LteUeRrc::CancelLeavingTrigger(uint8_t measId, uint16_t cellId)
{
NS_ASSERT(it2->measId == measId);
for (auto it3 = it2->concernedCells.begin(); it3 != it2->concernedCells.end(); ++it3)
{
if (*it3 == cellId)
{
it3 = it2->concernedCells.erase(it3);
}
}
it2->concernedCells.remove_if([cellId](auto cell) { return cellId == cell; });
if (it2->concernedCells.empty())
{