From nobody@FreeBSD.org  Thu Feb 28 15:17:35 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 4C16837B405
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 28 Feb 2002 15:17:32 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g1SNHWq57576;
	Thu, 28 Feb 2002 15:17:32 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200202282317.g1SNHWq57576@freefall.freebsd.org>
Date: Thu, 28 Feb 2002 15:17:32 -0800 (PST)
From: Morten Rodal <morten@rodal.no>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ping6 does not show standard deviation
X-Send-Pr-Version: www-1.0

>Number:         35433
>Category:       bin
>Synopsis:       ping6 does not show standard deviation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 28 15:20:01 PST 2002
>Closed-Date:    Fri Mar 1 01:51:07 PST 2002
>Last-Modified:  Fri Mar 01 01:51:53 PST 2002
>Originator:     Morten Rodal
>Release:        4.5-STABLE
>Organization:
>Environment:
FreeBSD gluon.rodal.no 4.5-STABLE FreeBSD 4.5-STABLE #5: Tue Feb 26 17:18:35 CET 2002     root@gluon.rodal.no:/usr/home/incoming/obj/usr/src/sys/gluon  i386
>Description:
The ping6 program does not show std. dev. This is easily enabled, and is enabled in the standard ipv4 ping.
>How-To-Repeat:
ping any ipv6 and the output will not show std. dev.
>Fix:
# diff Makefile.orig Makefile
11c11
< LDADD=        -lipsec -lmd
---
> LDADD=        -lipsec -lmd -lm



# diff ping6.c.orig ping6.c
126c126
< #if defined(__OpenBSD__) || defined(__NetBSD__)
---
> #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
236c236
< #if defined(__OpenBSD__) || defined(__NetBSD__)
---
> #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
1442c1442
< #if defined(__OpenBSD__) || defined(__NetBSD__)
---
> #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
2189c2189
< #if defined(__OpenBSD__) || defined(__NetBSD__)
---
> #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ume 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Thu Feb 28 17:20:43 PST 2002 
Responsible-Changed-Why:  
Looks like an easy IPv6 PR to fix - just enable's code for FreeBSD. 
UMEMOTO-san is the man to fix this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=35433 

From: Maxim Konovalov <maxim@macomnet.ru>
To: Morten Rodal <morten@rodal.no>
Cc: freebsd-gnats-submit@FreeBSD.ORG, <ume@FreeBSD.ORG>
Subject: Re: bin/35433: ping6 does not show standard deviation
Date: Fri, 1 Mar 2002 11:02:48 +0300 (MSK)

 The more comprehensive patch is:
 
 Index: Makefile
 ===================================================================
 RCS file: /home/ncvs/src/sbin/ping6/Makefile,v
 retrieving revision 1.8
 diff -u -r1.8 Makefile
 --- Makefile	2001/12/04 02:19:56	1.8
 +++ Makefile	2002/03/01 07:55:17
 @@ -9,8 +9,8 @@
  BINOWN=	root
  BINMODE=4555
 
 -LDADD=	-lipsec -lmd
 -DPADD= ${LIBIPSEC} ${LIBMD}
 +LDADD=	-lipsec -lm -lmd
 +DPADD= ${LIBIPSEC} ${LIBM} ${LIBMD}
 
  # kame scopeid hack
  CFLAGS+=-DKAME_SCOPEID
 Index: ping6.8
 ===================================================================
 RCS file: /home/ncvs/src/sbin/ping6/ping6.8,v
 retrieving revision 1.16
 diff -u -r1.16 ping6.8
 --- ping6.8	2002/02/07 16:50:02	1.16
 +++ ping6.8	2002/03/01 07:55:18
 @@ -302,7 +302,8 @@
  or if the program is terminated with a
  .Dv SIGINT ,
  a brief summary is displayed, showing the number of packets sent and
 -received, and the minimum, mean, and maximum of the round-trip times.
 +received, and the minimum, mean, maximum, and standard deviation of the
 +round-trip times.
  .Pp
  If
  .Nm
 @@ -313,9 +314,9 @@
  argument for
  .Xr stty 1 )
  signal, the current number of packets sent and received, and the
 -minimum, mean, and maximum of the round-trip times will be written to
 -the standard output in the same format as the standard completion
 -message.
 +minimum, mean, maximum, and standard deviation of the round-trip times
 +will be written to the standard output in the same format as the
 +standard completion message.
  .Pp
  This program is intended for use in network testing, measurement and
  management.
 Index: ping6.c
 ===================================================================
 RCS file: /home/ncvs/src/sbin/ping6/ping6.c,v
 retrieving revision 1.15
 diff -u -r1.15 ping6.c
 --- ping6.c	2002/01/15 15:10:52	1.15
 +++ ping6.c	2002/03/01 07:55:19
 @@ -123,7 +123,7 @@
  #include <err.h>
  #include <errno.h>
  #include <fcntl.h>
 -#if defined(__OpenBSD__) || defined(__NetBSD__)
 +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
  #include <math.h>
  #endif
  #include <signal.h>
 @@ -233,7 +233,7 @@
  double tmin = 999999999.0;	/* minimum round trip time */
  double tmax = 0.0;		/* maximum round trip time */
  double tsum = 0.0;		/* sum of all times, for doing average */
 -#if defined(__OpenBSD__) || defined(__NetBSD__)
 +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
  double tsumsq = 0.0;		/* sum of all times squared, for std. dev. */
  #endif
 
 @@ -1433,7 +1433,7 @@
  			triptime = ((double)tv.tv_sec) * 1000.0 +
  			    ((double)tv.tv_usec) / 1000.0;
  			tsum += triptime;
 -#if defined(__OpenBSD__) || defined(__NetBSD__)
 +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
  			tsumsq += triptime * triptime;
  #endif
  			if (triptime < tmin)
 @@ -2180,7 +2180,7 @@
  		/* Only display average to microseconds */
  		double num = nreceived + nrepeats;
  		double avg = tsum / num;
 -#if defined(__OpenBSD__) || defined(__NetBSD__)
 +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
  		double dev = sqrt(tsumsq / num - avg * avg);
  		(void)printf(
  		    "round-trip min/avg/max/std-dev = %.3f/%.3f/%.3f/%.3f ms\n",
 
 -- 
 Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer
 phone: +7 (095) 796-9079, mailto:maxim@macomnet.ru
 
State-Changed-From-To: open->closed 
State-Changed-By: ume 
State-Changed-When: Fri Mar 1 01:51:07 PST 2002 
State-Changed-Why:  
Thanks!  I just committed it. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=35433 
>Unformatted:
