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
This commit is contained in:
Michael Tuexen 2015-05-30 20:39:19 +00:00
parent 3105514edd
commit a6167a2523

View File

@ -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) {