The "-p" option states that the formula for calculating the port range equals base + 1 to base + nhops * nprobes. However, the parameters "nhops" and "nprobes" are called differently in their respective options to change them. "nprobes" is changed using the option "-q" which names the parameter "nqueries" instead of "nprobes" and "-m" specifies the parameter as "max_ttl" instead of "nhops".
I suggest modifying the formula to use the correct parameter names:
< number used in probes (default is 33434).
> number used in queries (default is 33434).
< .Em base + nhops * nprobes
> .Em base + max_ttl * nqueries
The file is /usr/share/man/man8/traceroute.8.gz.
tom:~/ $ zdiff -u /usr/share/man/man8/traceroute.8.gz ~/traceroute.8.gz [11:12:19]
--- - 2019-05-03 11:13:17.408669000 +0200
+++ /tmp/zdiff.XXXXXXXXXX.VfLmekMF 2019-05-03 11:13:17.403810000 +0200
@@ -120,14 +120,14 @@
Protocol specific. For UDP, UDP-Lite, TCP and SCTP, sets
-number used in probes (default is 33434).
+number used in queries (default is 33434).
Traceroute hopes that nothing is listening on UDP ports (or UDP-Lite ports
if used by
and supported by the peer)
.Em base + 1
-.Em base + nhops * nprobes
+.Em base + max_ttl * nqueries
at the destination host (so an ICMP PORT_UNREACHABLE message will
be returned to terminate the route tracing). If something is
listening on a port in the default range, this option can be used
Created attachment 204199 [details]
(In reply to Tom Marcoen from comment #2)
Based on the patch provided, I put up a modified version of the patch in
A commit references this bug:
Date: Thu Jun 20 12:38:41 UTC 2019
New revision: 349228
The variable names in the description of the port number usage is
inconsistent. This patch fixes that and improves the precision of
Thanks to Tom Marcoen for reporting the issue and providing an
initial patch, on which this change is based.
Reviewed by: bcr@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20708