diff --git a/src/wifi/model/wifi-mac-header.cc b/src/wifi/model/wifi-mac-header.cc index 22512e301..925523361 100644 --- a/src/wifi/model/wifi-mac-header.cc +++ b/src/wifi/model/wifi-mac-header.cc @@ -832,29 +832,25 @@ WifiMacHeader::IsPowerManagement() const bool WifiMacHeader::IsQosBlockAck() const { - NS_ASSERT(IsQosData()); - return (m_qosAckPolicy == 3); + return (IsQosData() && m_qosAckPolicy == 3); } bool WifiMacHeader::IsQosNoAck() const { - NS_ASSERT(IsQosData()); - return (m_qosAckPolicy == 1); + return (IsQosData() && m_qosAckPolicy == 1); } bool WifiMacHeader::IsQosAck() const { - NS_ASSERT(IsQosData()); - return (m_qosAckPolicy == 0); + return (IsQosData() && m_qosAckPolicy == 0); } bool WifiMacHeader::IsQosEosp() const { - NS_ASSERT(IsQosData()); - return (m_qosEosp == 1); + return (IsQosData() && m_qosEosp == 1); } WifiMacHeader::QosAckPolicy @@ -886,8 +882,7 @@ WifiMacHeader::GetQosAckPolicy() const bool WifiMacHeader::IsQosAmsdu() const { - NS_ASSERT(IsQosData()); - return (m_amsduPresent == 1); + return (IsQosData() && m_amsduPresent == 1); } uint8_t diff --git a/src/wifi/model/wifi-mac-header.h b/src/wifi/model/wifi-mac-header.h index 55dd4c9c0..6252444fe 100644 --- a/src/wifi/model/wifi-mac-header.h +++ b/src/wifi/model/wifi-mac-header.h @@ -555,33 +555,33 @@ class WifiMacHeader : public Header */ bool IsMoreFragments() const; /** - * Return if the QoS Ack policy is Block Ack. + * Return if IsQosData() is true and the QoS Ack policy is Block Ack. * - * @return true if the QoS Ack policy is Block Ack, false otherwise + * @return true if IsQosData() and the QoS Ack policy is Block Ack, false otherwise */ bool IsQosBlockAck() const; /** - * Return if the QoS Ack policy is No Ack. + * Return if IsQosData() is true and the QoS Ack policy is No Ack. * - * @return true if the QoS Ack policy is No Ack, false otherwise + * @return true if IsQosData() and the QoS Ack policy is No Ack, false otherwise */ bool IsQosNoAck() const; /** - * Return if the QoS Ack policy is Normal Ack. + * Return if IsQosData() is true and the QoS Ack policy is Normal Ack. * - * @return true if the QoS Ack policy is No Ack, false otherwise + * @return true if IsQosData() and the QoS Ack policy is No Ack, false otherwise */ bool IsQosAck() const; /** - * Return if the end of service period (EOSP) is set. + * Return if IsQosData() is true and the end of service period (EOSP) is set. * - * @return true if the end of service period (EOSP) is set, false otherwise + * @return true if IsQosData() and the end of service period (EOSP) is set, false otherwise */ bool IsQosEosp() const; /** - * Check if the A-MSDU present bit is set in the QoS control field. + * Check if IsQosData() is true and the A-MSDU present bit is set in the QoS control field. * - * @return true if the A-MSDU present bit is set, + * @return true if IsQosData() and the A-MSDU present bit is set, * false otherwise */ bool IsQosAmsdu() const;