wifi: Check TXVECTOR is valid when computing duration

This commit is contained in:
Sébastien Deronne
2024-10-19 08:34:06 +02:00
parent 4a3f076402
commit f7e98e7230
2 changed files with 6 additions and 2 deletions

View File

@@ -1564,6 +1564,7 @@ WifiPhy::CalculateTxDuration(uint32_t size,
WifiPhyBand band,
uint16_t staId)
{
NS_ASSERT(txVector.IsValid(band));
Time duration = CalculatePhyPreambleAndHeaderDuration(txVector) +
GetPayloadDuration(size, txVector, band, NORMAL_MPDU, staId);
NS_ASSERT(duration.IsStrictlyPositive());
@@ -1583,6 +1584,7 @@ WifiPhy::CalculateTxDuration(const WifiConstPsduMap& psduMap,
const WifiTxVector& txVector,
WifiPhyBand band)
{
NS_ASSERT(txVector.IsValid(band));
return GetStaticPhyEntity(txVector.GetModulationClass())
->CalculateTxDuration(psduMap, txVector, band);
}

View File

@@ -155,7 +155,8 @@ TxDurationTest::CheckPayloadDuration(uint32_t size,
{
testedBands.push_back(WIFI_PHY_BAND_6GHZ);
}
if (payloadMode.GetModulationClass() != WIFI_MOD_CLASS_VHT)
if ((payloadMode.GetModulationClass() != WIFI_MOD_CLASS_OFDM) &&
(payloadMode.GetModulationClass() != WIFI_MOD_CLASS_VHT) && (channelWidth < 80))
{
testedBands.push_back(WIFI_PHY_BAND_2_4GHZ);
}
@@ -207,7 +208,8 @@ TxDurationTest::CheckTxDuration(uint32_t size,
{
testedBands.push_back(WIFI_PHY_BAND_6GHZ);
}
if (payloadMode.GetModulationClass() != WIFI_MOD_CLASS_VHT)
if ((payloadMode.GetModulationClass() != WIFI_MOD_CLASS_OFDM) &&
(payloadMode.GetModulationClass() != WIFI_MOD_CLASS_VHT) && (channelWidth < 80))
{
testedBands.push_back(WIFI_PHY_BAND_2_4GHZ);
}