Try to preserve API compatibility, after SendFrom / promiscuous mode changes.
This commit is contained in:
@@ -96,7 +96,10 @@ Node::AddDevice (Ptr<NetDevice> device)
|
||||
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 @@ Node::RegisterPromiscuousProtocolHandler (PromiscuousProtocolHandler handler,
|
||||
entry.handler = handler;
|
||||
entry.protocol = protocolType;
|
||||
entry.device = device;
|
||||
if (device)
|
||||
{
|
||||
NS_ASSERT (device->SupportsPromiscuousReceiveCallback ());
|
||||
}
|
||||
m_promiscuousHandlers.push_back (entry);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user