From 8c2c1596e26831238178ac3a42bd543bff5dfe93 Mon Sep 17 00:00:00 2001
From: Tom Henderson
Date: Sat, 15 May 2010 16:46:47 -0700
Subject: [PATCH] bug 861: Log drop traces for forwarding failures into IPv4
and IPv6 ascii traces
---
CHANGES.html | 15 +++++++++++++
RELEASE_NOTES | 29 ++++++++++++++++++++++++++
src/internet-stack/ipv4-l3-protocol.cc | 9 ++++++--
src/internet-stack/ipv6-l3-protocol.cc | 9 +++++---
4 files changed, 57 insertions(+), 5 deletions(-)
diff --git a/CHANGES.html b/CHANGES.html
index 2a50ae239..62a1dc3b8 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -43,6 +43,21 @@ the cracks, unfortunately. If you, as a user, can suggest improvements
to this file based on your experience, please contribute a patch or drop
us a note on ns-developers mailing list.
+
+Changes from ns-3.8 to ns-3.9
+
+Changes to build system:
+
+New API:
+
+Changes to existing API:
+
+Changed behavior:
+
+- Drop trace logged for Ipv4/6 forwarding failure: Fixed bug 861; this
+will add ascii traces (drops) in Ipv4 and Ipv6 traces for forwarding failures
+
+
Changes from ns-3.7 to ns-3.8
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 33afc6e9e..dba8a33a7 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -9,6 +9,35 @@ http://www.nsnam.org including tutorials: http://www.nsnam.org/tutorials.html
Consult the file CHANGES.html for more detailed information about changed
API and behavior across ns-3 releases.
+Release 3.9
+===========
+
+Availability
+------------
+This release is not yet available.
+
+Supported platforms
+-------------------
+ns-3.9 has been tested on the following platforms:
+
+Not all ns-3 options are available on all platforms; consult the
+wiki for more information:
+http://www.nsnam.org/wiki/index.php/Installation
+
+New user-visible features
+-------------------------
+
+Bugs fixed
+----------
+The following lists many of the bugs that were fixed since ns-3.7, in
+many cases referencing the Bugzilla bug number
+
+ - bug 861 - Forwarding drops (due to no route found) were not being logged
+ in IPv4 or IPv6 ascii traces
+
+Known issues
+------------
+
Release 3.8
===========
diff --git a/src/internet-stack/ipv4-l3-protocol.cc b/src/internet-stack/ipv4-l3-protocol.cc
index 42de3e33a..2d20b2123 100644
--- a/src/internet-stack/ipv4-l3-protocol.cc
+++ b/src/internet-stack/ipv4-l3-protocol.cc
@@ -484,12 +484,17 @@ Ipv4L3Protocol::Receive( Ptr device, Ptr p, uint16_t pr
}
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 (), interface);
+ }
+
}
diff --git a/src/internet-stack/ipv6-l3-protocol.cc b/src/internet-stack/ipv6-l3-protocol.cc
index e30eeea2f..4142a762d 100644
--- a/src/internet-stack/ipv6-l3-protocol.cc
+++ b/src/internet-stack/ipv6-l3-protocol.cc
@@ -728,12 +728,15 @@ void Ipv6L3Protocol::Receive (Ptr device, Ptr p, uint16
}
}
- m_routingProtocol->RouteInput (packet, hdr, device,
+ if (! m_routingProtocol->RouteInput (packet, hdr, device,
MakeCallback (&Ipv6L3Protocol::IpForward, this),
MakeCallback (&Ipv6L3Protocol::IpMulticastForward, this),
MakeCallback (&Ipv6L3Protocol::LocalDeliver, this),
- MakeCallback (&Ipv6L3Protocol::RouteInputError, this)
- );
+ MakeCallback (&Ipv6L3Protocol::RouteInputError, this)))
+ {
+ NS_LOG_WARN ("No route found for forwarding packet. Drop.");
+ m_dropTrace (hdr, packet, DROP_NO_ROUTE, interface);
+ }
}
void Ipv6L3Protocol::SendRealOut (Ptr route, Ptr packet, Ipv6Header const& ipHeader)