From 2c504d3a3c096535164ce0e0d5062bdecb0104bb Mon Sep 17 00:00:00 2001 From: DavisRobertson1 <67032827+DavisRobertson1@users.noreply.github.com> Date: Fri, 25 Jul 2025 11:05:39 -0700 Subject: [PATCH] wifi: Fix OR operation with m_incrRetryCountUnderBa It should be outside of the second argument passed to GetBaAgreementEstablishedAsOriginator(). Otherwise will likely return BA agreement (or lack thereof) for the wrong tid and RSM attribute IncrementRetryCountUnderBa will not work properly. --- src/wifi/model/wifi-remote-station-manager.cc | 6 +++--- src/wifi/test/wifi-tx-stats-helper-test.cc | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index e7add1073..5ef19128a 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -1168,9 +1168,9 @@ WifiRemoteStationManager::DoIncrementRetryCountOnTxFailure(WifiRemoteStation* st const auto& hdr = psdu->GetHeader(0); if (hdr.IsMgt() || (hdr.IsData() && !hdr.IsQosData()) || - (hdr.IsQosData() && (!m_wifiMac->GetBaAgreementEstablishedAsOriginator( - hdr.GetAddr1(), - hdr.GetQosTid() || m_incrRetryCountUnderBa)))) + (hdr.IsQosData() && + (!m_wifiMac->GetBaAgreementEstablishedAsOriginator(hdr.GetAddr1(), hdr.GetQosTid()) || + m_incrRetryCountUnderBa))) { psdu->IncrementRetryCount(); } diff --git a/src/wifi/test/wifi-tx-stats-helper-test.cc b/src/wifi/test/wifi-tx-stats-helper-test.cc index 1abae68f5..be6e4b35d 100644 --- a/src/wifi/test/wifi-tx-stats-helper-test.cc +++ b/src/wifi/test/wifi-tx-stats-helper-test.cc @@ -168,6 +168,8 @@ WifiTxStatsHelperTest::DoSetup() void WifiTxStatsHelperTest::DoRun() { + Config::SetDefault("ns3::WifiRemoteStationManager::IncrementRetryCountUnderBa", + BooleanValue(true)); std::string dataMode; std::string ackMode; if (m_option == SINGLE_LINK_NON_QOS)