wifi: (fixes #1189) Avoid assert for non-QoS multicast frames

This commit is contained in:
Tom Henderson
2025-02-24 11:32:38 -08:00
parent e84022668a
commit f6d2f66f95
2 changed files with 15 additions and 20 deletions

View File

@@ -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

View File

@@ -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;