src/devices/csma-cd/csma-cd-net-device.cc
changeset 1231 01baeebb110e
parent 1230 5d03bbd566d9
parent 1210 599a311daef6
child 1232 2e8c3f8bb77f
--- a/src/devices/csma-cd/csma-cd-net-device.cc	Mon Aug 06 19:43:09 2007 +0200
+++ b/src/devices/csma-cd/csma-cd-net-device.cc	Tue Aug 07 08:36:31 2007 +0200
@@ -505,13 +505,15 @@
   // 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);
@@ -523,10 +525,15 @@
       (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:
@@ -546,8 +553,6 @@
   m_rxTrace (p);
   ForwardUp (p, protocol, header.GetSource ());
   return;
- drop:
-  m_dropTrace (p);
 }
 
 Ptr<Queue>