Fix up mac printing for /net/arp
authorRonald G. Minnich <rminnich@google.com>
Fri, 28 Mar 2014 18:52:19 +0000 (11:52 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sat, 29 Mar 2014 01:17:06 +0000 (18:17 -0700)
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
kern/src/net/arp.c

index 6a244ba..aa9130d 100644 (file)
@@ -522,7 +522,9 @@ static void convmac(char *p, uint8_t * mac, int n)
 {
        int left = n;
        while (n-- > 0) {
-               p += snprintf(p, left, "0x%2.2x", *mac++);
+               p += snprintf(p, left, "%02x", *mac++);
+               if (n > 1)
+                       p += snprintf(p, left, ":");
                left -= n;
        }
 }