diff --git a/src/dsr/model/dsr-options.cc b/src/dsr/model/dsr-options.cc index 1caaafccd..119752cef 100644 --- a/src/dsr/model/dsr-options.cc +++ b/src/dsr/model/dsr-options.cc @@ -802,9 +802,8 @@ uint8_t DsrOptionRreq::Process (Ptr packet, Ptr dsrP, Ipv4Addres 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 @@ uint8_t DsrOptionRerr::Process (Ptr packet, Ptr dsrP, Ipv4Addres /* * 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 */ diff --git a/src/dsr/model/dsr-routing.cc b/src/dsr/model/dsr-routing.cc index 5da4f18ac..0ac9aca1a 100644 --- a/src/dsr/model/dsr-routing.cc +++ b/src/dsr/model/dsr-routing.cc @@ -1034,12 +1034,11 @@ bool DsrRouting::PromiscReceive (Ptr device, Ptr packet 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);