Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 May 2015 20:39:20 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283786 - head/contrib/traceroute
Message-ID:  <201505302039.t4UKdKTL011156@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat May 30 20:39:19 2015
New Revision: 283786
URL: https://svnweb.freebsd.org/changeset/base/283786

Log:
  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

Modified:
  head/contrib/traceroute/traceroute.c

Modified: head/contrib/traceroute/traceroute.c
==============================================================================
--- head/contrib/traceroute/traceroute.c	Sat May 30 19:52:28 2015	(r283785)
+++ head/contrib/traceroute/traceroute.c	Sat May 30 20:39:19 2015	(r283786)
@@ -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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505302039.t4UKdKTL011156>