# HG changeset patch # User Tom Henderson # Date 1242915516 25200 # Node ID edd044a61f365c61b1795e5015b5566c73186bd4 # Parent 1db0749fa7c6e1b43d88d16de72f571c60998da9 fix bug 571 (EmuNetDevice disables multicast unnecessarily) diff -r 1db0749fa7c6 -r edd044a61f36 src/devices/emu/emu-net-device.cc --- a/src/devices/emu/emu-net-device.cc Thu May 21 06:46:38 2009 -0700 +++ b/src/devices/emu/emu-net-device.cc Thu May 21 07:18:36 2009 -0700 @@ -173,7 +173,9 @@ EmuNetDevice::EmuNetDevice () m_sock (-1), m_readThread (0), m_ifIndex (std::numeric_limits::max ()), // absurdly large value - m_sll_ifindex (-1) + m_sll_ifindex (-1), + m_isBroadcast (false), + m_isMulticast (false) { NS_LOG_FUNCTION (this); Start (m_tStart); @@ -293,7 +295,14 @@ EmuNetDevice::StartDevice (void) { NS_FATAL_ERROR ("EmuNetDevice::StartDevice(): " << m_deviceName << " is not in promiscuous mode"); } - + if ((ifr.ifr_flags & IFF_MULTICAST) == 1) + { + m_isMulticast = true; + } + if ((ifr.ifr_flags & IFF_BROADCAST) == 1) + { + m_isBroadcast = true; + } // // Now spin up a read thread to read packets. // @@ -918,7 +927,7 @@ bool bool EmuNetDevice::IsBroadcast (void) const { - return true; + return m_isBroadcast; } Address @@ -930,7 +939,7 @@ bool bool EmuNetDevice::IsMulticast (void) const { - return false; + return m_isMulticast; } Address diff -r 1db0749fa7c6 -r edd044a61f36 src/devices/emu/emu-net-device.h --- a/src/devices/emu/emu-net-device.h Thu May 21 06:46:38 2009 -0700 +++ b/src/devices/emu/emu-net-device.h Thu May 21 07:18:36 2009 -0700 @@ -453,6 +453,18 @@ private: bool m_linkUp; /** + * Flag indicating whether or not the underlying net device has a valid + * broadcast address set. + */ + bool m_isBroadcast; + + /** + * Flag indicating whether or not the underlying net device supports + * multicast. + */ + bool m_isMulticast; + + /** * Callback to fire if the link changes state (up or down). */ Callback m_linkChangeCallback;