diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index 1f7c0c40b..2da2bb8a7 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -1542,9 +1542,9 @@ HeFrameExchangeManager::SetTxopHolder(Ptr psdu, const WifiTxVect { NS_LOG_FUNCTION(this << psdu << txVector); - if (psdu->GetHeader(0).IsTrigger()) + if (psdu->GetHeader(0).IsTrigger() && psdu->GetAddr2() == m_bssid) { - m_txopHolder = psdu->GetAddr2(); + m_txopHolder = m_bssid; } else if (!txVector.IsUlMu()) // the sender of a TB PPDU is not the TXOP holder { diff --git a/src/wifi/model/qos-frame-exchange-manager.cc b/src/wifi/model/qos-frame-exchange-manager.cc index dbd2f4a9f..623861e5f 100644 --- a/src/wifi/model/qos-frame-exchange-manager.cc +++ b/src/wifi/model/qos-frame-exchange-manager.cc @@ -683,11 +683,16 @@ QosFrameExchangeManager::SetTxopHolder(Ptr psdu, const WifiTxVec const WifiMacHeader& hdr = psdu->GetHeader(0); - if (hdr.IsQosData() || hdr.IsMgt() || hdr.IsRts()) + // A STA shall save the TXOP holder address for the BSS in which it is associated. + // The TXOP holder address is the MAC address from the Address 2 field of the frame + // that initiated a frame exchange sequence, except if this is a CTS frame, in which + // case the TXOP holder address is the Address 1 field. (Sec. 10.23.2.4 of 802.11-2020) + if ((hdr.IsQosData() || hdr.IsMgt() || hdr.IsRts()) && + (hdr.GetAddr1() == m_bssid || hdr.GetAddr2() == m_bssid)) { m_txopHolder = psdu->GetAddr2(); } - else if (hdr.IsCts()) + else if (hdr.IsCts() && hdr.GetAddr1() == m_bssid) { m_txopHolder = psdu->GetAddr1(); }