diff options
author | tuexen <tuexen@FreeBSD.org> | 2015-05-30 20:39:19 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2015-05-30 20:39:19 +0000 |
commit | 9dca4be9f7c2d41dec963a116ec4a950f31b5a93 (patch) | |
tree | 17109ca70703c154d2cabc79a1c7f805652a2d61 /contrib/traceroute | |
parent | e99dc1c8d6513eaf87ab23f6be27a188335d57c0 (diff) | |
download | FreeBSD-src-9dca4be9f7c2d41dec963a116ec4a950f31b5a93.zip FreeBSD-src-9dca4be9f7c2d41dec963a116ec4a950f31b5a93.tar.gz |
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
Diffstat (limited to 'contrib/traceroute')
-rw-r--r-- | contrib/traceroute/traceroute.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c index e05a532..040d04d 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) { |