From 2d6f46dfa89c0ae6c8ee2d1f2f718218d81e2ab2 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 19 Dec 2007 13:24:52 +0100 Subject: [PATCH] forward only packets for ourselves. --- src/devices/wifi/mac-high-adhoc.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devices/wifi/mac-high-adhoc.cc b/src/devices/wifi/mac-high-adhoc.cc index 5a05c205f..5cd7da55f 100644 --- a/src/devices/wifi/mac-high-adhoc.cc +++ b/src/devices/wifi/mac-high-adhoc.cc @@ -103,7 +103,10 @@ void MacHighAdhoc::Receive (Ptr packet, WifiMacHeader const *hdr) { NS_LOG_DEBUG ("received size="<GetSize ()<<", from="<GetAddr2 ()); - m_callback (packet, hdr->GetAddr2 ()); + if (hdr->GetAddr1 ().IsBroadcast () || hdr->GetAddr1 () == m_device->GetSelfAddress ()) + { + m_callback (packet, hdr->GetAddr2 ()); + } } } // namespace ns3