Module Name:    src
Committed By:   jakllsch
Date:           Sat Mar 29 14:20:14 UTC 2014

Modified Files:
        src/sys/lib/libsa: ether_sprintf.c

Log Message:
Obtain and use ETHER_ADDR_LEN where appropriate.
Drop unnecessary includes.

XXX libsa ether_sprintf() should maybe be ether_snprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/lib/libsa/ether_sprintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libsa/ether_sprintf.c
diff -u src/sys/lib/libsa/ether_sprintf.c:1.6 src/sys/lib/libsa/ether_sprintf.c:1.7
--- src/sys/lib/libsa/ether_sprintf.c:1.6	Sat Nov 24 13:20:55 2007
+++ src/sys/lib/libsa/ether_sprintf.c	Sat Mar 29 14:20:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ether_sprintf.c,v 1.6 2007/11/24 13:20:55 isaki Exp $	*/
+/*	$NetBSD: ether_sprintf.c,v 1.7 2014/03/29 14:20:14 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1992 Regents of the University of California.
@@ -47,8 +47,7 @@
 #include <string.h>
 #endif
 
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
+#include <net/if_ether.h>
 
 #include "stand.h"
 #include "net.h"
@@ -60,10 +59,10 @@ char *
 ether_sprintf(const u_char *ap)
 {
 	int i;
-	static char etherbuf[18];
+	static char etherbuf[3*ETHER_ADDR_LEN];
 	char *cp = etherbuf;
 
-	for (i = 0; i < 6; i++) {
+	for (i = 0; i < ETHER_ADDR_LEN; i++) {
 		*cp++ = hexdigits[*ap >> 4];
 		*cp++ = hexdigits[*ap++ & 0xf];
 		*cp++ = ':';

Reply via email to