From 124bb898813f5dcc34ceb888b02f73be9cad7dc6 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Thu, 7 Jul 2022 19:03:22 +0200 Subject: [PATCH] wifi: Use link address to match Address fields of Mgt frames --- src/wifi/model/ap-wifi-mac.cc | 2 +- src/wifi/model/sta-wifi-mac.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index bc5d5c6a9..00f8a4916 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -1333,7 +1333,7 @@ ApWifiMac::Receive (Ptr mpdu, uint8_t linkId) } return; } - else if (hdr->GetAddr1 () == GetAddress ()) + else if (hdr->GetAddr1 () == GetFrameExchangeManager (linkId)->GetAddress ()) { if (hdr->IsAssocReq () || hdr->IsReassocReq ()) { diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index fb15fa9ae..de8f97399 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -710,13 +710,13 @@ StaWifiMac::Receive (Ptr mpdu, uint8_t linkId) const WifiMacHeader* hdr = &mpdu->GetHeader (); Ptr 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);