src/node/node.cc
changeset 3445 ae9f7d5e2d56
parent 3437 7cec39fe195c
child 3446 8491c6c05d22
--- a/src/node/node.cc	Fri Jul 04 18:48:10 2008 +0100
+++ b/src/node/node.cc	Fri Jul 04 19:15:00 2008 +0100
@@ -96,7 +96,10 @@
   device->SetNode (this);
   device->SetIfIndex(index);
   device->SetReceiveCallback (MakeCallback (&Node::ReceiveFromDevice, this));
-  device->SetPromiscuousReceiveCallback (MakeCallback (&Node::PromiscuousReceiveFromDevice, this));
+  if (device->SupportsPromiscuousReceiveCallback ())
+    {
+      device->SetPromiscuousReceiveCallback (MakeCallback (&Node::PromiscuousReceiveFromDevice, this));
+    }
   NotifyDeviceAdded (device);
   return index;
 }
@@ -191,6 +194,10 @@
   entry.handler = handler;
   entry.protocol = protocolType;
   entry.device = device;
+  if (device)
+    {
+      NS_ASSERT (device->SupportsPromiscuousReceiveCallback ());
+    }
   m_promiscuousHandlers.push_back (entry);
 }