summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>2004-10-25 13:50:39 +0000
committerEric Norum <WENorum@lbl.gov>2004-10-25 13:50:39 +0000
commitbb5b40485651d5b8f8f49754a7a482cb37c898d0 (patch)
tree2e29e15ccd8a0f7ac6a620d2aa5f2c83c79c1ee0 /cpukit
parentChanges for new build system. (diff)
downloadrtems-bb5b40485651d5b8f8f49754a7a482cb37c898d0.tar.bz2
Install working version of ether_sprintf().
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog4
-rw-r--r--cpukit/libnetworking/net/if_ethersubr.c20
2 files changed, 15 insertions, 9 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 8e241fac34..2d3d1c0acc 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,7 @@
+2004-10-25 Eric Norum <norume@aps.anl.gov>
+
+ * libnetworking/net/if_ethersubr.c: Working version of ether_sprintf().
+
2004-10-22 Ralf Corsepius <ralf_corsepius@rtems.org>
* libnetworking/Makefile.am: Reflect changes below.
diff --git a/cpukit/libnetworking/net/if_ethersubr.c b/cpukit/libnetworking/net/if_ethersubr.c
index 4d802860d5..4ae25fbbeb 100644
--- a/cpukit/libnetworking/net/if_ethersubr.c
+++ b/cpukit/libnetworking/net/if_ethersubr.c
@@ -512,18 +512,20 @@ ether_input(ifp, eh, m)
/*
* Convert Ethernet address to printable (loggable) representation.
- * This routine is for compatibility; it's better to just use
- *
- * printf("%6D", <pointer to address>, ":");
- *
- * since there's no static buffer involved.
+ * The static buffer isn't a really huge problem since this code
+ * is protected by the RTEMS network mutex.
*/
char *
-ether_sprintf(const u_char *ap)
+ether_sprintf(const u_int8_t *addr)
{
- static char etherbuf[18];
- snprintf(etherbuf, sizeof (etherbuf), "%6D", ap, ":");
- return (etherbuf);
+ static char buf[32];
+ char *b = buf;
+ int i;
+
+ for (i = 0; i < ETHER_ADDR_LEN; i++, b+=3)
+ sprintf(b, "%02x:", *addr++);
+ *--b = '\0';
+ return buf;
}
/*