Bugzilla – Bug 861
add drop trace for condition when Ipv4RoutingProtocol::RouteInput() is false
Last modified: 2010-05-15 19:47:42 UTC
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); + } + }
(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.
changeset bd1da3a75496 (ns-3.9)