lte: (fixes #885) Don't send RAR when UE context is not created

This commit is contained in:
kkoutlia
2023-05-26 17:03:54 +02:00
committed by Tom Henderson
parent c51af10e4e
commit 42756add13
2 changed files with 9 additions and 0 deletions

View File

@@ -526,6 +526,14 @@ LteEnbMac::DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo)
else
{
rnti = m_cmacSapUser->AllocateTemporaryCellRnti();
if (rnti == 0)
{
// If rnti = 0, UE context was not created (not enough SRS)
// Therefore don't send RAR for this preamble
NS_LOG_INFO("UE Context not created, no RAR is send");
continue;
}
NS_LOG_INFO("preambleId " << (uint32_t)it->first << ": allocated T-C-RNTI "
<< (uint32_t)rnti << ", sending RAR");
}

View File

@@ -3123,6 +3123,7 @@ LteEnbRrc::DoAllocateTemporaryCellRnti(uint8_t componentCarrierId)
// if no SRS index is available, then do not create a new UE context.
if (IsMaxSrsReached())
{
NS_LOG_WARN("Not enough SRS configuration index, UE context not created");
return 0; // return 0 since new RNTI was not assigned for the received preamble
}
return AddUe(UeManager::INITIAL_RANDOM_ACCESS, componentCarrierId);