From 7617186e8f8bda678894000c42269ae9d6d222ee Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Fri, 1 Apr 2022 13:27:30 +0200 Subject: [PATCH] wifi: Fix Duration/ID setting when TXOP Limit is exceeded --- src/wifi/model/qos-frame-exchange-manager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wifi/model/qos-frame-exchange-manager.cc b/src/wifi/model/qos-frame-exchange-manager.cc index 017d43ea7..f231f20ef 100644 --- a/src/wifi/model/qos-frame-exchange-manager.cc +++ b/src/wifi/model/qos-frame-exchange-manager.cc @@ -455,13 +455,15 @@ QosFrameExchangeManager::GetFrameDurationId (const WifiMacHeader& header, uint32 return FrameExchangeManager::GetFrameDurationId (header, size, txParams, fragmentedPacket); } + NS_ASSERT (txParams.m_acknowledgment && txParams.m_acknowledgment->acknowledgmentTime != Time::Min ()); + // under multiple protection settings, if the TXOP limit is not null, Duration/ID // is set to cover the remaining TXOP time (Sec. 9.2.5.2 of 802.11-2016). // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8 // of 802.11-2016) return std::max (m_edca->GetRemainingTxop () - m_phy->CalculateTxDuration (size, txParams.m_txVector, m_phy->GetPhyBand ()), - Seconds (0)); + txParams.m_acknowledgment->acknowledgmentTime); } Time