wifi: Use link address to match Address fields of Mgt frames

This commit is contained in:
Stefano Avallone
2022-07-07 19:03:22 +02:00
committed by Stefano Avallone
parent ec20fc0951
commit 124bb89881
2 changed files with 4 additions and 4 deletions

View File

@@ -1333,7 +1333,7 @@ ApWifiMac::Receive (Ptr<WifiMpdu> mpdu, uint8_t linkId)
}
return;
}
else if (hdr->GetAddr1 () == GetAddress ())
else if (hdr->GetAddr1 () == GetFrameExchangeManager (linkId)->GetAddress ())
{
if (hdr->IsAssocReq () || hdr->IsReassocReq ())
{

View File

@@ -710,13 +710,13 @@ StaWifiMac::Receive (Ptr<WifiMpdu> mpdu, uint8_t linkId)
const WifiMacHeader* hdr = &mpdu->GetHeader ();
Ptr<const Packet> packet = mpdu->GetPacket ();
NS_ASSERT (!hdr->IsCtl ());
if (hdr->GetAddr3 () == GetAddress ())
Mac48Address myAddr = hdr->IsData () ? GetAddress () : GetFrameExchangeManager (linkId)->GetAddress ();
if (hdr->GetAddr3 () == myAddr)
{
NS_LOG_LOGIC ("packet sent by us.");
return;
}
if (hdr->GetAddr1 () != GetAddress ()
&& !hdr->GetAddr1 ().IsGroup ())
if (hdr->GetAddr1 () != myAddr && !hdr->GetAddr1 ().IsGroup ())
{
NS_LOG_LOGIC ("packet is not for us");
NotifyRxDrop (packet);