summaryrefslogtreecommitdiff
path: root/contrib/traceroute
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2015-05-30 20:39:19 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2015-05-30 20:39:19 +0000
commita6167a2523459d691301c1c4031241fd3e728c0b (patch)
tree17109ca70703c154d2cabc79a1c7f805652a2d61 /contrib/traceroute
parent3105514edd87624085e7deb331da336c7aeb1923 (diff)
downloadsrc-test-a6167a2523459d691301c1c4031241fd3e728c0b.tar.gz
src-test-a6167a2523459d691301c1c4031241fd3e728c0b.zip
There is no payload anymore. So compute the minimum packet length
correctly and use 40 as the default (if the minumum allows it), as specified in the man page. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=283786
Diffstat (limited to 'contrib/traceroute')
-rw-r--r--contrib/traceroute/traceroute.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c
index e05a5329fd3d6..040d04d6b4595 100644
--- a/contrib/traceroute/traceroute.c
+++ b/contrib/traceroute/traceroute.c
@@ -669,8 +669,11 @@ main(int argc, char **argv)
if (lsrr > 0)
optlen = (lsrr + 1) * sizeof(gwlist[0]);
- minpacket = sizeof(*outip) + proto->hdrlen + sizeof(struct outdata) + optlen;
- packlen = minpacket; /* minimum sized packet */
+ minpacket = sizeof(*outip) + proto->hdrlen + optlen;
+ if (minpacket > 40)
+ packlen = minpacket;
+ else
+ packlen = 40;
/* Process destination and optional packet size */
switch (argc - optind) {