From nobody@FreeBSD.org  Wed Mar  7 00:27:08 2001
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 A65FD37B71A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  7 Mar 2001 00:25:46 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f278PkB28624;
	Wed, 7 Mar 2001 00:25:46 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200103070825.f278PkB28624@freefall.freebsd.org>
Date: Wed, 7 Mar 2001 00:25:46 -0800 (PST)
From: davidx@viasoft.com.cn
To: freebsd-gnats-submit@FreeBSD.org
Subject: arp.c - better printed ether address
X-Send-Pr-Version: www-1.0

>Number:         25584
>Category:       bin
>Synopsis:       arp.c - better printed ether address
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 07 00:30:03 PST 2001
>Closed-Date:    Tue Mar 26 14:10:34 PST 2002
>Last-Modified:  Tue Mar 26 14:10:34 PST 2002
>Originator:     David Xu
>Release:        FreeBSD 4.3-BETA
>Organization:
Viasoft
>Environment:
FreeBSD davidbsd.viasoft.com.cn 4.3-BETA FreeBSD 4.3-BETA #0: Wed Mar  7 15:30:1
1 CST 2001     xyf@davidbsd.viasoft.com.cn:/usr/obj/usr/src/sys/xu  i386
>Description:
the ether address printed by /usr/sbin/arp is not so fine, 
some bytes is printed in two bytes while others not.


>How-To-Repeat:
stock version prints:
davidbsd# arp -n -a
? (192.168.1.98) at 0:e0:4c:6b:a6:9 [ethernet]
? (192.168.1.109) at 0:e0:4c:3f:49:eb [ethernet]
? (192.168.1.254) at 0:b0:c2:89:a4:6e [ethernet]
? (192.168.1.255) at ff:ff:ff:ff:ff:ff permanent [ethernet]

better vesion prints
davidbsd# arp -n -a
? (192.168.1.98) at 00:e0:4c:6b:a6:09 [ethernet]
? (192.168.1.109) at 00:e0:4c:3f:49:eb [ethernet]
? (192.168.1.254) at 00:b0:c2:89:a4:6e [ethernet]
? (192.168.1.255) at ff:ff:ff:ff:ff:ff permanent [ethernet]

>Fix:
--- arp.c.orig	Wed Mar  7 16:06:11 2001
+++ arp.c	Wed Mar  7 16:10:29 2001
@@ -537,7 +537,7 @@
 void
 ether_print(u_char *cp)
 {
-	printf("%x:%x:%x:%x:%x:%x", cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]);
+	printf("%02x:%02x:%02x:%02x:%02x:%02x", cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]);
 }
 
 int

>Release-Note:
>Audit-Trail:

From: Ruslan Ermilov <ru@FreeBSD.org>
To: davidx@viasoft.com.cn
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/25584: arp.c - better printed ether address
Date: Wed, 7 Mar 2001 10:37:33 +0200

 Everything is OK, but why do you think it is better?  :-)
 
 
 Cheers,
 -- 
 Ruslan Ermilov		Oracle Developer/DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age

From: Chris Dillon <cdillon@wolves.k12.mo.us>
To: <davidx@viasoft.com.cn>
Cc: <freebsd-gnats-submit@FreeBSD.ORG>
Subject: Re: bin/25584: arp.c - better printed ether address
Date: Wed, 7 Mar 2001 15:48:35 -0600 (CST)

 On Wed, 7 Mar 2001 davidx@viasoft.com.cn wrote:
 
 >
 > >Number:         25584
 > >Category:       bin
 > >Synopsis:       arp.c - better printed ether address
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:
 > >Keywords:
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Wed Mar 07 00:30:03 PST 2001
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     David Xu
 > >Release:        FreeBSD 4.3-BETA
 > >Organization:
 > Viasoft
 > >Environment:
 > FreeBSD davidbsd.viasoft.com.cn 4.3-BETA FreeBSD 4.3-BETA #0: Wed Mar  7 15:30:1
 > 1 CST 2001     xyf@davidbsd.viasoft.com.cn:/usr/obj/usr/src/sys/xu  i386
 > >Description:
 > the ether address printed by /usr/sbin/arp is not so fine,
 > some bytes is printed in two bytes while others not.
 >
 >
 > >How-To-Repeat:
 > stock version prints:
 > davidbsd# arp -n -a
 > ? (192.168.1.98) at 0:e0:4c:6b:a6:9 [ethernet]
 > ? (192.168.1.109) at 0:e0:4c:3f:49:eb [ethernet]
 > ? (192.168.1.254) at 0:b0:c2:89:a4:6e [ethernet]
 > ? (192.168.1.255) at ff:ff:ff:ff:ff:ff permanent [ethernet]
 >
 > better vesion prints
 > davidbsd# arp -n -a
 > ? (192.168.1.98) at 00:e0:4c:6b:a6:09 [ethernet]
 > ? (192.168.1.109) at 00:e0:4c:3f:49:eb [ethernet]
 > ? (192.168.1.254) at 00:b0:c2:89:a4:6e [ethernet]
 > ? (192.168.1.255) at ff:ff:ff:ff:ff:ff permanent [ethernet]
 
 This will probably turn into a bikeshed argument, but....
 
 I would have to heartily agree with you that this is the correct way
 to do things.  While it _might_ break something that parses arp(8)
 output, always using two digits is how I have seen it done everywhere
 else.  You should be able to remove all of the colons and always have
 a correct MAC address (12 digits), which is not the case currently.
 
 
 -- Chris Dillon - cdillon@wolves.k12.mo.us - cdillon@inter-linc.net
    FreeBSD: The fastest and most stable server OS on the planet.
    For IA32 and Alpha architectures. IA64, PPC, and ARM under development.
    http://www.freebsd.org
 
 

From: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To: davidx@viasoft.com.cn
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: bin/25584: arp.c - better printed ether address
Date: Wed, 7 Mar 2001 16:49:40 -0500 (EST)

 <<On Wed, 7 Mar 2001 00:25:46 -0800 (PST), davidx@viasoft.com.cn said:
 
 > -	printf("%x:%x:%x:%x:%x:%x", cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]);
 > +	printf("%02x:%02x:%02x:%02x:%02x:%02x", cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]);
 
 FWIW, I like this change.
 
 -GAWollman
 
State-Changed-From-To: open->suspended 
State-Changed-By: billf 
State-Changed-When: Wed Mar 7 17:54:07 PST 2001 
State-Changed-Why:  
committed, pr remains suspended to serve as a reminder to 
merge this to -stable after the thaw. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25584 
State-Changed-From-To: suspended->closed 
State-Changed-By: cjc 
State-Changed-When: Tue Mar 26 14:08:46 PST 2002 
State-Changed-Why:  
billf said he didn't mind if someone else MFC'ed it, so I did. 

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