switch ndp to display MAC addresses in 00:00:00:00:00:00 format, ok deraadt@
authorsthen <sthen@openbsd.org>
Fri, 22 Aug 2014 22:37:32 +0000 (22:37 +0000)
committersthen <sthen@openbsd.org>
Fri, 22 Aug 2014 22:37:32 +0000 (22:37 +0000)
usr.sbin/ndp/ndp.c

index ee310f3..98e22d5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ndp.c,v 1.55 2014/08/19 12:39:36 mpi Exp $    */
+/*     $OpenBSD: ndp.c,v 1.56 2014/08/22 22:37:32 sthen Exp $  */
 /*     $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $   */
 
 /*
@@ -781,7 +781,7 @@ ether_str(struct sockaddr_dl *sdl)
 
        if (sdl->sdl_alen) {
                cp = (u_char *)LLADDR(sdl);
-               snprintf(hbuf, sizeof(hbuf), "%x:%x:%x:%x:%x:%x",
+               snprintf(hbuf, sizeof(hbuf), "%02x:%02x:%02x:%02x:%02x:%02x",
                    cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]);
        } else
                snprintf(hbuf, sizeof(hbuf), "(incomplete)");