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.
Fixes: 0c2218d1d5fd ("traceroute6: Implement ECN bleaching detection")
MFC after: 2 weeks
Co-Authored-By: Claude Opus 5.5