wifi: Check TXVECTOR is valid when computing duration
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user