Subject: lib/1696: bug in ether_ntoa
To: None <gnats-bugs@gnats.netbsd.org>
From: None <maja@celsiustech.se>
List: netbsd-bugs
Date: 10/26/1995 21:13:14
>Number: 1696
>Category: lib
>Synopsis: ether_ntoa isn't a la Sun (as claimed)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: lib-bug-people (Library Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Oct 26 16:35:01 1995
>Last-Modified:
>Originator: Mats O Jansson
>Organization:
CelsiusTech System AB, Jaerfaella, Sweden
>Release: NetBSD-current 1995/10/21
>Environment:
System: NetBSD meg.celsiustech.se 1.1_ALPHA NetBSD 1.1_ALPHA (MEG-VT) #0: Sun Oct 22 09:12:26 MET 1995 root@meg.celsiustech.se:/usr/src/sys/arch/i386/compile/MEG-VT i386
>Description:
usr/src/lib/libc/net/ethers.c claims to be an implemenation a la Sun.
But ether_ntoa returns a string different from the one returned by
SunOS 4 and AIX.
>How-To-Repeat:
If ether_ntoa is called with an struct ether_addr containing the
ethernet address 08:00:20:f:47:11
SunOS will return a string "8:0:20:f:47:11" but
NetBSD will return "08:00:20:0f:47:11".
>Fix:
*** ethers.c.orig Sat Oct 14 01:49:16 1995
--- ethers.c Thu Oct 26 20:29:48 1995
***************
*** 29,35 ****
{
static char a[] = "xx:xx:xx:xx:xx:xx";
! sprintf(a, "%02x:%02x:%02x:%02x:%02x:%02x",
e->ether_addr_octet[0], e->ether_addr_octet[1],
e->ether_addr_octet[2], e->ether_addr_octet[3],
e->ether_addr_octet[4], e->ether_addr_octet[5]);
--- 29,35 ----
{
static char a[] = "xx:xx:xx:xx:xx:xx";
! sprintf(a, "%x:%x:%x:%x:%x:%x",
e->ether_addr_octet[0], e->ether_addr_octet[1],
e->ether_addr_octet[2], e->ether_addr_octet[3],
e->ether_addr_octet[4], e->ether_addr_octet[5]);
>Audit-Trail:
>Unformatted: