NetBSD Problem Report #22102
Received: (qmail 11857 invoked by uid 605); 9 Jul 2003 08:33:38 -0000
Message-Id: <200307090833.h698XW1v029664@speedy.ludd.luth.se>
Date: Wed, 9 Jul 2003 10:33:32 +0200 (CEST)
From: ragge@ludd.luth.se
Sender: gnats-bugs-owner@netbsd.org
Reply-To: ragge@ludd.luth.se
To: gnats-bugs@gnats.netbsd.org
Subject: ttcp calculates line speed wrong.
X-Send-Pr-Version: 3.95
>Number: 22102
>Category: pkg
>Synopsis: ttcp calculates line speed wrong.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bsiegert
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jul 09 08:34:00 +0000 2003
>Closed-Date: Sat Jul 04 16:16:18 +0000 2015
>Last-Modified: Sat Jul 04 16:16:18 +0000 2015
>Originator:
>Release: NetBSD 1.6Q
>Organization:
---------------------------------------------------------------------------
- Anders Magnusson - ragge@ludd.luth.se - Luleå Academic Computer Society -
- May the carrier be with you! -
>Environment:
System: NetBSD speedy 1.6Q NetBSD 1.6Q (GENERIC) #0: Tue Apr 8 07:45:42 UTC 2003 autobuild@cs20.apochromatic.org:/autobuilder/build/HEAD/alpha/OBJ/autobuilder/build/HEAD/src/sys/arch/alpha/compile/GENERIC alpha
Architecture: alpha
Machine: alpha
>Description:
pkgsrc/benchmarks/ttcp calculates the line speed wrong.
When dealing with line speeds, Kbit is 1000, not 1024; Mbit
is 1000000, not 1048576 etc, but ttcp uses multiples of 1024
to get the line speed.
>How-To-Repeat:
Just try ttcp.
>Fix:
The following patch (to the patched pkgsrc ttcp.c) fixes the bug:
--- ttcp.c.org 2003-07-09 10:18:53.000000000 +0200
+++ ttcp.c 2003-07-09 10:20:44.000000000 +0200
@@ -490,13 +490,13 @@
sprintf(obuf, "%.2f MB", b / 1024.0 / 1024.0);
break;
case 'g':
- sprintf(obuf, "%.2f Gbit", b * 8.0 / 1024.0 / 1024.0 / 1024.0);
+ sprintf(obuf, "%.2f Gbit", b * 8.0 / 1000.0 / 1000.0 / 1000.0);
break;
case 'k':
- sprintf(obuf, "%.2f Kbit", b * 8.0 / 1024.0);
+ sprintf(obuf, "%.2f Kbit", b * 8.0 / 1000.0);
break;
case 'm':
- sprintf(obuf, "%.2f Mbit", b * 8.0 / 1024.0 / 1024.0);
+ sprintf(obuf, "%.2f Mbit", b * 8.0 / 1000.0 / 1000.0);
break;
}
return obuf;
>Release-Note:
>Audit-Trail:
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: ragge@ludd.luth.se
Cc: gnats-bugs@gnats.netbsd.org, <netbsd-bugs@netbsd.org>
Subject: Re: pkg/22102: ttcp calculates line speed wrong.
Date: Wed, 9 Jul 2003 07:18:20 -0700 (PDT)
On Wed, 9 Jul 2003 ragge@ludd.luth.se wrote:
> >Description:
> pkgsrc/benchmarks/ttcp calculates the line speed wrong.
> When dealing with line speeds, Kbit is 1000, not 1024; Mbit
> is 1000000, not 1048576 etc, but ttcp uses multiples of 1024
> to get the line speed.
Here is a webpage about it (which also discusses a wrap-around bug):
http://ctd.grc.nasa.gov/5610/publications/TTCP-recommend.txt
http://sd.wareonearth.com/~phil/net/ttcp/
In addition to the source code patches, the man page should add a note
showing that this change was done.
Jeremy C. Reed
http://bsd.reedmedia.net/
Responsible-Changed-From-To: pkg-manager->thorpej
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Sat, 19 Mar 2005 01:34:08 +0000
Responsible-Changed-Why:
Over to maintainer.
Responsible-Changed-From-To: thorpej->pkg-manager
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Sun, 15 Apr 2012 21:46:49 +0000
Responsible-Changed-Why:
Back to role account, thorpej left
From: "Benny Siegert" <bsiegert@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/22102 CVS commit: pkgsrc/benchmarks/ttcp
Date: Sat, 4 Jul 2015 16:11:53 +0000
Module Name: pkgsrc
Committed By: bsiegert
Date: Sat Jul 4 16:11:53 UTC 2015
Modified Files:
pkgsrc/benchmarks/ttcp: Makefile distinfo
pkgsrc/benchmarks/ttcp/patches: patch-ab
Log Message:
Use 1000-based units for line speeds. From Anders Magnusson in
PR pkg/22102, in 2003.
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 pkgsrc/benchmarks/ttcp/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/benchmarks/ttcp/distinfo
cvs rdiff -u -r1.9 -r1.10 pkgsrc/benchmarks/ttcp/patches/patch-ab
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Responsible-Changed-From-To: pkg-manager->bsiegert
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Sat, 04 Jul 2015 16:16:18 +0000
Responsible-Changed-Why:
State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sat, 04 Jul 2015 16:16:18 +0000
State-Changed-Why:
Committed (12 years later), thanks!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.