Bug 861 - add drop trace for condition when Ipv4RoutingProtocol::RouteInput() is false
add drop trace for condition when Ipv4RoutingProtocol::RouteInput() is false
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
pre-release
All All
: P5 normal
Assigned To: Tom Henderson
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-06 00:23 EDT by Tom Henderson
Modified: 2010-05-15 19:47 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2010-04-06 00:23:50 EDT
Suggested on ns-developers mailing list here:
http://mailman.isi.edu/pipermail/ns-developers/2010-April/007766.html

Here is an untested patch.

diff -r b920710704c9 src/internet-stack/ipv4-l3-protocol.cc
--- a/src/internet-stack/ipv4-l3-protocol.cc    Tue Mar 30 12:55:14 2010 -0400
+++ b/src/internet-stack/ipv4-l3-protocol.cc    Mon Apr 05 21:20:32 2010 -0700
@@ -484,12 +484,17 @@ Ipv4L3Protocol::Receive( Ptr<NetDevice> 
     }
 
   NS_ASSERT_MSG (m_routingProtocol != 0, "Need a routing protocol object to process packets");
-  m_routingProtocol->RouteInput (packet, ipHeader, device, 
+  if (! m_routingProtocol->RouteInput (packet, ipHeader, device, 
     MakeCallback (&Ipv4L3Protocol::IpForward, this),
     MakeCallback (&Ipv4L3Protocol::IpMulticastForward, this),
     MakeCallback (&Ipv4L3Protocol::LocalDeliver, this),
     MakeCallback (&Ipv4L3Protocol::RouteInputError, this)
-  );
+  ))
+    {
+      NS_LOG_WARN ("No route found for forwarding packet.  Drop.");
+      m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, m_node->GetObject<Ipv4> (), interface);
+    }
+
 
 }
Comment 1 Tom Henderson 2010-04-06 01:56:40 EDT
(In reply to comment #0)
> Suggested on ns-developers mailing list here:
> http://mailman.isi.edu/pipermail/ns-developers/2010-April/007766.html

well, this is not really what the user was asking for, but still may be worth adding something like this since we have similar drop traces for route failures in outbound direction.
Comment 2 Tom Henderson 2010-05-15 19:47:42 EDT
changeset bd1da3a75496 (ns-3.9)