Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 May 2015 08:10:35 +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: r283806 - head/contrib/traceroute
Message-ID:  <201505310810.t4V8AZWR074647@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sun May 31 08:10:35 2015
New Revision: 283806
URL: https://svnweb.freebsd.org/changeset/base/283806

Log:
  When the packet verification fails in verbose mode, print the correct
  number of words in host byte order. Also remove a stray 'x'.
  
  MFC after: 3 days

Modified:
  head/contrib/traceroute/traceroute.c

Modified: head/contrib/traceroute/traceroute.c
==============================================================================
--- head/contrib/traceroute/traceroute.c	Sun May 31 07:31:20 2015	(r283805)
+++ head/contrib/traceroute/traceroute.c	Sun May 31 08:10:35 2015	(r283806)
@@ -1346,8 +1346,8 @@ packet_ok(register u_char *buf, int cc, 
 		Printf("\n%d bytes from %s to ", cc, inet_ntoa(from->sin_addr));
 		Printf("%s: icmp type %d (%s) code %d\n",
 		    inet_ntoa(ip->ip_dst), type, pr_type(type), icp->icmp_code);
-		for (i = 4; i < cc ; i += sizeof(*lp))
-			Printf("%2d: x%8.8x\n", i, *lp++);
+		for (i = 4; i <= cc - ICMP_MINLEN; i += sizeof(*lp))
+			Printf("%2d: %8.8x\n", i, ntohl(*lp++));
 	}
 #endif
 	return(0);



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