diff --git a/src/devices/csma-cd/csma-cd-net-device.cc b/src/devices/csma-cd/csma-cd-net-device.cc index 141daf68c..d941c2691 100644 --- a/src/devices/csma-cd/csma-cd-net-device.cc +++ b/src/devices/csma-cd/csma-cd-net-device.cc @@ -477,13 +477,15 @@ CsmaCdNetDevice::Receive (const Packet& packet) // Only receive if send side of net device is enabled if (!IsReceiveEnabled()) { - goto drop; + m_dropTrace (p); + return; } if (m_encapMode == RAW) { ForwardUp (packet, 0, GetBroadcast ()); - goto drop; + m_dropTrace (p); + return; } p.RemoveTrailer(trailer); trailer.CheckFcs(p); @@ -495,10 +497,15 @@ CsmaCdNetDevice::Receive (const Packet& packet) (header.GetDestination() != destination)) { // not for us. - goto drop; + m_dropTrace (p); + return; } +// +// protocol must be initialized to avoid a compiler warning in the RAW +// case that breaks the optimized build. +// + uint16_t protocol = 0; - uint16_t protocol; switch (m_encapMode) { case ETHERNET_V1: @@ -518,8 +525,6 @@ CsmaCdNetDevice::Receive (const Packet& packet) m_rxTrace (p); ForwardUp (p, protocol, header.GetSource ()); return; - drop: - m_dropTrace (p); } Ptr diff --git a/src/routing/global-routing/global-router-interface.h b/src/routing/global-routing/global-router-interface.h index 737643d9e..61351d34b 100644 --- a/src/routing/global-routing/global-router-interface.h +++ b/src/routing/global-routing/global-router-interface.h @@ -550,7 +550,7 @@ public: */ bool GetLSA (uint32_t n, GlobalRouterLSA &lsa) const; -protected: +private: virtual ~GlobalRouter (); void ClearLSAs (void); @@ -564,13 +564,14 @@ protected: Ipv4Address m_routerId; -private: // inherited from Object virtual void DoDispose (void); + /** * @brief Global Router copy construction is disallowed. */ GlobalRouter (GlobalRouter& sr); + /** * @brief Global Router assignment operator is disallowed. */