From never@kurush.osdn.org.ua  Sat Jan 18 11:55:26 2003
Return-Path: <never@kurush.osdn.org.ua>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9582537B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Jan 2003 11:55:26 -0800 (PST)
Received: from kurush.osdn.org.ua (external.osdn.org.ua [212.40.34.156])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9C75543F13
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Jan 2003 11:55:23 -0800 (PST)
	(envelope-from never@kurush.osdn.org.ua)
Received: from kurush.osdn.org.ua (never@localhost [127.0.0.1])
	by kurush.osdn.org.ua (8.12.6/8.12.6) with ESMTP id h0IJtDWK096446
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Jan 2003 21:55:14 +0200 (EET)
	(envelope-from never@kurush.osdn.org.ua)
Received: (from never@localhost)
	by kurush.osdn.org.ua (8.12.6/8.12.6/Submit) id h0IJtCFC096445;
	Sat, 18 Jan 2003 21:55:12 +0200 (EET)
Message-Id: <200301181955.h0IJtCFC096445@kurush.osdn.org.ua>
Date: Sat, 18 Jan 2003 21:55:12 +0200 (EET)
From: Alexandr Kovalenko <never@nevermind.kiev.ua>
Reply-To: Alexandr Kovalenko <never@nevermind.kiev.ua>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ipfw won't format correctly output from 'ipfw show' command
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         47196
>Category:       bin
>Synopsis:       ipfw won't format correctly output from 'ipfw show' command
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    maxim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 18 12:00:21 PST 2003
>Closed-Date:    Mon Apr 14 05:43:34 PDT 2003
>Last-Modified:  Mon Apr 14 05:43:34 PDT 2003
>Originator:     Alexandr Kovalenko
>Release:        FreeBSD 4.7-RELEASE i386
>Organization:
WNet ISP, Kiev, Ukraine, http://wnet.ua/
>Environment:
System: FreeBSD kurush.osdn.org.ua 4.7-RELEASE FreeBSD 4.7-RELEASE #1: Tue Oct 15 17:18:12 EEST 2002 root@kurush.osdn.org.ua:/usr/obj/usr/src/sys/kurush i386

>Description:
ipfw won't give correctly formatted output sometimes:

# ipfw show
00100   17414412 24493518226 pipe 1 tcp from 131.159.72.23 to me
00200   13555157  744076885 pipe 2 tcp from me to 131.159.72.23
65535  120556691 99880809179 allow ip from any to any

>How-To-Repeat:
N/A
>Fix:
N/A

>Release-Note:
>Audit-Trail:

From: Giorgos Keramidas <keramida@freebsd.org>
To: Alexandr Kovalenko <never@nevermind.kiev.ua>
Cc: bug-followup@freebsd.org
Subject: Re: bin/47196: ipfw won't format correctly output from 'ipfw show'
 command
Date: Sun, 19 Jan 2003 01:17:31 +0200 (EET)

 On 2003-01-18 21:55, Alexandr Kovalenko wrote:
 > ipfw won't give correctly formatted output sometimes:
 >
 > # ipfw show
 > 00100   17414412 24493518226 pipe 1 tcp from 131.159.72.23 to me
 > 00200   13555157  744076885 pipe 2 tcp from me to 131.159.72.23
 > 65535  120556691 99880809179 allow ip from any to any
 
 This is a result of a small buglet in ipfw2.c.  In the function
 show_ipfw() a width specifier of 10 characters is used for a quad_t
 number, which is obviously not sufficient:
 
 In revision 1.21 of src/sbin/ipfw/ipfw2.c this is near lines:
 
     825         if (do_acct)
     826                 printf("%10qu %10qu ", rule->pcnt, rule->bcnt);
 
 Similar bugs exist elsewhere in the same file:
 
    1215         printf("%05d %10qu %10qu (%ds)",
    1216             d->rulenum, d->pcnt, d->bcnt, d->expire);
 
    1306                 printf("%4qu %8qu %2u %4u %3u\n",
    1307                     q[l].tot_pkts, q[l].tot_bytes,
    1308                     q[l].len, q[l].len_bytes, q[l].drops);
 
 Since an unsigned quad_t can possibly have a value that is wider than
 10 characters, all these should be changed to at least a width that
 can easily accomodate unsigned 64-bit numbers: 20 characters.  This
 will push a lot of stuff to the right though, making it difficult to
 read `ipfw show' output in 80-column terminals... but we can't have it
 all, can we?
 
 - Giorgos
Responsible-Changed-From-To: freebsd-bugs->ipfw 
Responsible-Changed-By: johan 
Responsible-Changed-When: Mon Feb 3 12:38:39 PST 2003 
Responsible-Changed-Why:  
Over to maintainer group. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47196 
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Thu Mar 13 02:52:10 PST 2003 
State-Changed-Why:  
Fixed in rev. 1.22 src/sbin/ipfw/ipfw2.c in -CURRENT. 


Responsible-Changed-From-To: ipfw->maxim 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Thu Mar 13 02:52:10 PST 2003 
Responsible-Changed-Why:  
Will MFC the fix in one month. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47196 
State-Changed-From-To: patched->closed 
State-Changed-By: maxim 
State-Changed-When: Mon Apr 14 05:42:40 PDT 2003 
State-Changed-Why:  
Fixed in -STABLE as well (rev. 1.4.2.12 src/sbin/ipfw/ipfw2.c). 

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