Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Mar 2001 00:25:46 -0800 (PST)
From:      davidx@viasoft.com.cn
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/25584: arp.c - better printed ether address
Message-ID:  <200103070825.f278PkB28624@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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]

>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103070825.f278PkB28624>