git: 098eea00500e - main - traceroute6: do not print an ECN report for an echo reply
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Nov 2026 20:39:39 UTC
The branch main has been updated by maxim:
URL: https://cgit.FreeBSD.org/src/commit/?id=098eea00500eaf1f2e495cac3d43c393ecbcb15a
commit 098eea00500eaf1f2e495cac3d43c393ecbcb15a
Author: Maxim Konovalov <maxim@FreeBSD.org>
AuthorDate: 2026-11-16 00:34:34 +0000
Commit: Maxim Konovalov <maxim@FreeBSD.org>
CommitDate: 2026-11-17 20:34:55 +0000
traceroute6: do not print an ECN report for an echo reply
packet_ok() takes the ECN bits from the IPv6 header quoted by an
ICMPv6 error message. The destination answers an ICMPv6 probe (-I)
with an echo reply, which repeats the ICMPv6 data of the probe but not
its IPv6 header, so for that reply the main loop used whatever an
earlier packet had left in ecn.
With -E the ECN report for the destination therefore repeated the
bits quoted by an earlier ICMPv6 error. If no ICMPv6 error had been
received before, because the destination is one hop away, the first
hops are skipped with -f or the routers on the path are silent, ecn
was still uninitialized:
$ traceroute6 -E -I -n -q 1 ::1
traceroute6 to ::1 (::1) from ::1, 64 hops max, 20 byte packets
1 ::1 0.055 ms (ecn=bleached)
Print the ECN report only when there is a quoted header. Document
that there is no ECN report for an echo reply.
Reviewed by: jlduran, Kevin Day
Fixes: 0c2218d1d5fd ("traceroute6: Implement ECN bleaching detection")
MFC after: 2 weeks
Co-Authored-By: Claude Opus 5.5
Differential Revision: https://reviews.freebsd.org/D61607
---
usr.sbin/traceroute6/traceroute6.8 | 5 ++++-
usr.sbin/traceroute6/traceroute6.c | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/usr.sbin/traceroute6/traceroute6.8 b/usr.sbin/traceroute6/traceroute6.8
index 7c6890d4de6a..2144364ab527 100644
--- a/usr.sbin/traceroute6/traceroute6.8
+++ b/usr.sbin/traceroute6/traceroute6.8
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 16, 2026
+.Dd November 15, 2026
.Dt TRACEROUTE6 8
.Os
.\"
@@ -109,6 +109,9 @@ or mangled
them, or if it is experiencing congestion
.Pq Dv 11 .
Otherwise, report that it passed the bits appropriately.
+The report is taken from the probe header quoted in the ICMPv6 error message
+sent by the hop, so there is none for a destination which answers an ICMPv6
+probe with an echo reply.
If
.Fl t
is also specified, the corresponding ECN bits will be replaced.
diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c
index 7b821c11db38..1bb3b982a705 100644
--- a/usr.sbin/traceroute6/traceroute6.c
+++ b/usr.sbin/traceroute6/traceroute6.c
@@ -975,7 +975,9 @@ main(int argc, char *argv[])
lastaddr = Rcv.sin6_addr;
}
printf(" %.3f ms", deltaT(&t1, &t2));
- if (ecnflag) {
+ /* An echo reply quotes no header. */
+ if (ecnflag &&
+ type != ICMP6_ECHO_REPLY) {
switch (ecn) {
case IPTOS_ECN_ECT1:
printf(" (ecn=passed)");