diff --git a/src/devices/wifi/nqap-wifi-mac.cc b/src/devices/wifi/nqap-wifi-mac.cc index 69405a971..a79cd7200 100644 --- a/src/devices/wifi/nqap-wifi-mac.cc +++ b/src/devices/wifi/nqap-wifi-mac.cc @@ -418,28 +418,38 @@ NqapWifiMac::Receive (Ptr packet, WifiMacHeader const *hdr) { NS_LOG_FUNCTION (this << packet << hdr); - WifiRemoteStation *station = m_stationManager->Lookup (hdr->GetAddr2 ()); + Mac48Address from = hdr->GetAddr2 (); + WifiRemoteStation *fromStation = m_stationManager->Lookup (from); if (hdr->IsData ()) { + Mac48Address bssid = hdr->GetAddr1 (); if (!hdr->IsFromDs () && hdr->IsToDs () && - hdr->GetAddr1 () == GetAddress () && - station->IsAssociated ()) + bssid == GetAddress () && + fromStation->IsAssociated ()) { - if (hdr->GetAddr3 () == GetAddress ()) + Mac48Address to = hdr->GetAddr3 (); + WifiRemoteStation *toStation = m_stationManager->Lookup (to); + if (to == GetAddress ()) { - NS_LOG_DEBUG ("frame for me from="<GetAddr2 ()); - ForwardUp (packet, hdr->GetAddr2 (), hdr->GetAddr1 ()); + NS_LOG_DEBUG ("frame for me from="<IsAssociated ()) { - NS_LOG_DEBUG ("forwarding frame from="<GetAddr2 ()<<", to="<GetAddr3 ()); + NS_LOG_DEBUG ("forwarding frame from="<