From dg@nexus.dglawrence.com  Fri May 16 06:19:46 2003
Return-Path: <dg@nexus.dglawrence.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CEDE237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 16 May 2003 06:19:46 -0700 (PDT)
Received: from dglawrence.com (12-224-163-157.client.attbi.com [12.224.163.157])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 491BE43FBD
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 16 May 2003 06:19:46 -0700 (PDT)
	(envelope-from dg@nexus.dglawrence.com)
Received: from nexus.dglawrence.com (localhost [127.0.0.1])
	by dglawrence.com (8.12.9/8.12.6) with ESMTP id h4GDKFFu062835
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 16 May 2003 06:20:15 -0700 (PDT)
	(envelope-from dg@nexus.dglawrence.com)
Received: (from dg@localhost)
	by nexus.dglawrence.com (8.12.9/8.12.3/Submit) id h4GDKFnk062834;
	Fri, 16 May 2003 06:20:15 -0700 (PDT)
Message-Id: <200305161320.h4GDKFnk062834@nexus.dglawrence.com>
Date: Fri, 16 May 2003 06:20:15 -0700 (PDT)
From: "David G. Lawrence" <dg@nexus.dglawrence.com>
Reply-To: "David G. Lawrence" <dg@nexus.dglawrence.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: formatting of RTT wrong in ping6
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52324
>Category:       bin
>Synopsis:       formatting of RTT wrong in ping6
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    maxim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 16 06:20:07 PDT 2003
>Closed-Date:    Tue Jul 29 05:25:50 PDT 2003
>Last-Modified:  Tue Jul 29 05:25:50 PDT 2003
>Originator:     David G. Lawrence
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Download Technologies, Inc.
>Environment:
System: FreeBSD nexus.dglawrence.com 4.8-STABLE FreeBSD 4.8-STABLE #0: Tue Apr 29 08:52:57 PDT 2003 dg@nexus.dglawrence.com:/a/src/sys/compile/NEXUS i386


	
>Description:
The output format specifier for the round-trip time in ping6 should be
changed to %.3f instead of %g since %g doesn't accurately represent the
precision of the number being output. In particular, %g truncates trailing
zeroes. 0.01 ms does not mean the same thing as 0.010 ms. Although they
are numerically identical, they do not have the same precision. This was
fixed by me in IPv4 ping in rev 1.2, almost 9 years ago.
>How-To-Repeat:
Use IPv6 and ping a host. Notice occasional truncated precision when the
RTT ends in one or more zeroes.
>Fix:

Index: ping6.c
===================================================================
RCS file: /home/ncvs/src/sbin/ping6/ping6.c,v
retrieving revision 1.4.2.10
diff -c -r1.4.2.10 ping6.c
*** ping6.c	9 Dec 2002 03:04:44 -0000	1.4.2.10
--- ping6.c	16 May 2003 13:05:33 -0000
***************
*** 1481,1487 ****
  				    sizeof(dstsa)));
  			}
  			if (timing)
! 				(void)printf(" time=%g ms", triptime);
  			if (dupflag)
  				(void)printf("(DUP!)");
  			/* check the data */
--- 1481,1487 ----
  				    sizeof(dstsa)));
  			}
  			if (timing)
! 				(void)printf(" time=%.3f ms", triptime);
  			if (dupflag)
  				(void)printf("(DUP!)");
  			/* check the data */
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Mon Jul 21 04:23:54 PDT 2003 
State-Changed-Why:  
Fixed in -CURRENT, thanks. 


Responsible-Changed-From-To: freebsd-bugs->maxim 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Mon Jul 21 04:23:54 PDT 2003 
Responsible-Changed-Why:  
MFC reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52324 
State-Changed-From-To: patched->closed 
State-Changed-By: maxim 
State-Changed-When: Tue Jul 29 05:25:27 PDT 2003 
State-Changed-Why:  
Fixed in -STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52324 
>Unformatted:
