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: 123c123 < number used in probes (default is 33434). --- > number used in queries (default is 33434). 130c130 < .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 the base .Ar port -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 .Nm and supported by the peer) .Em base + 1 to -.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] Patch
(In reply to Tom Marcoen from comment #2) Based on the patch provided, I put up a modified version of the patch in https://reviews.freebsd.org/D20708
A commit references this bug: Author: tuexen Date: Thu Jun 20 12:38:41 UTC 2019 New revision: 349228 URL: https://svnweb.freebsd.org/changeset/base/349228 Log: The variable names in the description of the port number usage is inconsistent. This patch fixes that and improves the precision of the description. Thanks to Tom Marcoen for reporting the issue and providing an initial patch, on which this change is based. PR: 237723 Reviewed by: bcr@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20708 Changes: head/contrib/traceroute/traceroute.8
A commit references this bug: Author: tuexen Date: Sat Sep 7 10:39:49 UTC 2019 New revision: 351970 URL: https://svnweb.freebsd.org/changeset/base/351970 Log: MFC r349228: The variable names in the description of the port number usage is inconsistent. This patch fixes that and improves the precision of the description. Thanks to Tom Marcoen for reporting the issue and providing an initial patch, on which this change is based. PR: 237723 Reviewed by: bcr@ Differential Revision: https://reviews.freebsd.org/D20708 Changes: _U stable/12/ stable/12/contrib/traceroute/traceroute.8
A commit references this bug: Author: tuexen Date: Mon Sep 9 10:44:58 UTC 2019 New revision: 352055 URL: https://svnweb.freebsd.org/changeset/base/352055 Log: The variable names in the description of the port number usage is inconsistent. This patch fixes that and improves the precision of the description. Thanks to Tom Marcoen for reporting the issue and providing an initial patch, on which this change is based. PR: 237723 Reviewed by: bcr@ Differential Revision: https://reviews.freebsd.org/D20708 Changes: _U stable/11/ stable/11/contrib/traceroute/traceroute.8