Skip to content

Commit f6d2f66

Browse files
committed
wifi: (fixes #1189) Avoid assert for non-QoS multicast frames
1 parent e840226 commit f6d2f66

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

src/wifi/model/wifi-mac-header.cc

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -832,29 +832,25 @@ WifiMacHeader::IsPowerManagement() const
832832
bool
833833
WifiMacHeader::IsQosBlockAck() const
834834
{
835-
NS_ASSERT(IsQosData());
836-
return (m_qosAckPolicy == 3);
835+
return (IsQosData() && m_qosAckPolicy == 3);
837836
}
838837

839838
bool
840839
WifiMacHeader::IsQosNoAck() const
841840
{
842-
NS_ASSERT(IsQosData());
843-
return (m_qosAckPolicy == 1);
841+
return (IsQosData() && m_qosAckPolicy == 1);
844842
}
845843

846844
bool
847845
WifiMacHeader::IsQosAck() const
848846
{
849-
NS_ASSERT(IsQosData());
850-
return (m_qosAckPolicy == 0);
847+
return (IsQosData() && m_qosAckPolicy == 0);
851848
}
852849

853850
bool
854851
WifiMacHeader::IsQosEosp() const
855852
{
856-
NS_ASSERT(IsQosData());
857-
return (m_qosEosp == 1);
853+
return (IsQosData() && m_qosEosp == 1);
858854
}
859855

860856
WifiMacHeader::QosAckPolicy
@@ -886,8 +882,7 @@ WifiMacHeader::GetQosAckPolicy() const
886882
bool
887883
WifiMacHeader::IsQosAmsdu() const
888884
{
889-
NS_ASSERT(IsQosData());
890-
return (m_amsduPresent == 1);
885+
return (IsQosData() && m_amsduPresent == 1);
891886
}
892887

893888
uint8_t

src/wifi/model/wifi-mac-header.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -555,33 +555,33 @@ class WifiMacHeader : public Header
555555
*/
556556
bool IsMoreFragments() const;
557557
/**
558-
* Return if the QoS Ack policy is Block Ack.
558+
* Return if IsQosData() is true and the QoS Ack policy is Block Ack.
559559
*
560-
* @return true if the QoS Ack policy is Block Ack, false otherwise
560+
* @return true if IsQosData() and the QoS Ack policy is Block Ack, false otherwise
561561
*/
562562
bool IsQosBlockAck() const;
563563
/**
564-
* Return if the QoS Ack policy is No Ack.
564+
* Return if IsQosData() is true and the QoS Ack policy is No Ack.
565565
*
566-
* @return true if the QoS Ack policy is No Ack, false otherwise
566+
* @return true if IsQosData() and the QoS Ack policy is No Ack, false otherwise
567567
*/
568568
bool IsQosNoAck() const;
569569
/**
570-
* Return if the QoS Ack policy is Normal Ack.
570+
* Return if IsQosData() is true and the QoS Ack policy is Normal Ack.
571571
*
572-
* @return true if the QoS Ack policy is No Ack, false otherwise
572+
* @return true if IsQosData() and the QoS Ack policy is No Ack, false otherwise
573573
*/
574574
bool IsQosAck() const;
575575
/**
576-
* Return if the end of service period (EOSP) is set.
576+
* Return if IsQosData() is true and the end of service period (EOSP) is set.
577577
*
578-
* @return true if the end of service period (EOSP) is set, false otherwise
578+
* @return true if IsQosData() and the end of service period (EOSP) is set, false otherwise
579579
*/
580580
bool IsQosEosp() const;
581581
/**
582-
* Check if the A-MSDU present bit is set in the QoS control field.
582+
* Check if IsQosData() is true and the A-MSDU present bit is set in the QoS control field.
583583
*
584-
* @return true if the A-MSDU present bit is set,
584+
* @return true if IsQosData() and the A-MSDU present bit is set,
585585
* false otherwise
586586
*/
587587
bool IsQosAmsdu() const;

0 commit comments

Comments
 (0)