fix some logging code for optimized builds
authorTom Henderson <tomh@tomh.org>
Tue, 22 May 2012 21:41:55 -0700
changeset 8792 8f15de62d18e
parent 8791 cfec9c446d40
child 8793 9c59d55abcce
fix some logging code for optimized builds
src/dsr/model/dsr-options.cc
src/dsr/model/dsr-routing.cc
--- a/src/dsr/model/dsr-options.cc	Tue May 22 21:37:34 2012 -0700
+++ b/src/dsr/model/dsr-options.cc	Tue May 22 21:41:55 2012 -0700
@@ -802,9 +802,8 @@
               rrep.SetNodesAddress (m_finalRoute);     // Set the node addresses in the route reply header
               // Get the real source of the reply
               Ipv4Address realSource = m_finalRoute.back ();
-              Ipv4Address realDst = m_finalRoute.front ();
               PrintVector (m_finalRoute);
-              NS_LOG_DEBUG ("This is the full route from " << realSource << " to " << realDst);
+              NS_LOG_DEBUG ("This is the full route from " << realSource << " to " << m_finalRoute.front ());
               /*
                * This part add dsr header to the packet and send route reply packet
                */
@@ -1355,11 +1354,10 @@
       /*
        * Get the error destination address
        */
-      Ipv4Address targetAddress = rerrUnreach.GetErrorDst ();
       Ipv4Address unreachAddress = rerrUnreach.GetUnreachNode ();
       Ipv4Address errorSource = rerrUnreach.GetErrorSrc ();
 
-      NS_LOG_DEBUG ("The destination address and the unreachable node " << targetAddress << " " << unreachAddress);
+      NS_LOG_DEBUG ("The destination address and the unreachable node " << rerrUnreach.GetErrorDst () << " " << unreachAddress);
       /*
        * Get the serialized size of the rerr header
        */
--- a/src/dsr/model/dsr-routing.cc	Tue May 22 21:37:34 2012 -0700
+++ b/src/dsr/model/dsr-routing.cc	Tue May 22 21:41:55 2012 -0700
@@ -1034,12 +1034,11 @@
           if (optionType == 96)        // This is the source route option
             {
               dsrOption = GetOption (optionType);       // Get the relative DSR option and demux to the process function
-              Ipv4Address fromAddr = GetIPfromMAC (Mac48Address::ConvertFrom (from));
-              Ipv4Address toAddr = GetIPfromMAC (Mac48Address::ConvertFrom (to));
-
-              NS_LOG_DEBUG (Simulator::Now ().GetSeconds ()
-                            << " DSR node " << m_mainAddress <<
-                            " overhearing packet PID: " << p->GetUid () << " from " << fromAddr << " to " << toAddr <<
+              NS_LOG_DEBUG (Simulator::Now ().GetSeconds () << 
+                            " DSR node " << m_mainAddress <<
+                            " overhearing packet PID: " << p->GetUid () <<
+                            " from " << GetIPfromMAC (Mac48Address::ConvertFrom (from)) <<
+                            " to " << GetIPfromMAC (Mac48Address::ConvertFrom (to)) <<
                             " with source IP " << ipv4Header.GetSource () <<
                             " and destination IP " << ipv4Header.GetDestination () <<
                             " and packet : " << *dsrPacket);