src/internet-node/arp-ipv4-interface.cc
changeset 933 df68dad55087
parent 745 221fda1d30f8
child 934 1bfcc65213c7
child 1167 2cb083ff04c6
--- a/src/internet-node/arp-ipv4-interface.cc	Mon Jul 16 22:49:48 2007 -0700
+++ b/src/internet-node/arp-ipv4-interface.cc	Wed Jul 18 11:43:39 2007 +0100
@@ -21,6 +21,7 @@
  */
 
 #include "ns3/packet.h"
+#include "ns3/debug.h"
 #include "ns3/composite-trace-resolver.h"
 #include "ns3/node.h"
 #include "ns3/net-device.h"
@@ -60,7 +61,19 @@
     {
       Ptr<ArpPrivate> arp = m_node->QueryInterface<ArpPrivate> (ArpPrivate::iid);
       MacAddress hardwareDestination;
-      bool found = arp->Lookup (p, dest, GetDevice (), &hardwareDestination);
+      bool found;
+
+      if (dest.IsBroadcast ())
+        {
+           hardwareDestination = GetDevice ()->GetBroadcast ();
+           found = true;
+        }
+      else
+        {
+          Ptr<ArpPrivate> arp = m_node->QueryInterface<ArpPrivate> (ArpPrivate::iid);
+          found = arp->Lookup (p, dest, GetDevice (), &hardwareDestination);
+        }
+
       if (found)
         {
           GetDevice ()->Send (p, hardwareDestination, Ipv4L3Protocol::PROT_NUMBER);