From 50b3bbeaebd9157bc72eb04aae6291b8fa9d686a Mon Sep 17 00:00:00 2001 From: Craig Dowell Date: Sun, 8 Aug 2010 19:15:08 -0700 Subject: [PATCH] Change NonPromiscReceiveFromDevice per bug 949. --- src/node/node.cc | 2 +- src/node/node.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/node/node.cc b/src/node/node.cc index 8867cefa9..d22bca727 100644 --- a/src/node/node.cc +++ b/src/node/node.cc @@ -263,7 +263,7 @@ Node::NonPromiscReceiveFromDevice (Ptr device, Ptr pack const Address &from) { NS_LOG_FUNCTION(this); - return ReceiveFromDevice (device, packet, protocol, from, from, NetDevice::PacketType (0), false); + return ReceiveFromDevice (device, packet, protocol, from, device->GetAddress(), NetDevice::PacketType (0), false); } bool diff --git a/src/node/node.h b/src/node/node.h index bb19cb631..1f04c20da 100644 --- a/src/node/node.h +++ b/src/node/node.h @@ -139,11 +139,13 @@ public: * \param sender the address of the sender * \param receiver the address of the receiver; Note: this value is * only valid for promiscuous mode protocol - * handlers. + * handlers. Note: If the L2 protocol does not use L2 + * addresses, the address reported here is the value of + * device->GetAddress(). * \param packetType type of packet received * (broadcast/multicast/unicast/otherhost); Note: * this value is only valid for promiscuous mode - * protocol handlers. + * protocol handlers. */ typedef Callback, Ptr,uint16_t,const Address &, const Address &, NetDevice::PacketType> ProtocolHandler; @@ -195,7 +197,6 @@ private: * This method is invoked whenever a user calls Node::AddDevice. */ virtual void NotifyDeviceAdded (Ptr device); - bool NonPromiscReceiveFromDevice (Ptr device, Ptr, uint16_t protocol, const Address &from); bool PromiscReceiveFromDevice (Ptr device, Ptr, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType);