[PATCH] aesthetics for interface.c, and proper printout for "sit0"

Robert P. J. Day rpjday at mindspring.com
Mon Jun 26 12:01:01 UTC 2006


  now that i have commit access (whoo hoo!  a round for the house,
barkeep, and put it on my tab), i figure i'll run potential patches
past the collective first.

  this patch has already been presented in two parts.  it's mostly
aesthetic, but also cleans up the output format for the "sit0"
interface to be consistent with that from the most recent net-tools.

  comments?  i realize we're in feature freeze, but this is a fairly
innocuous change and does fix the minor bug regarding sit0.  if it's
too late for this sort of thing, i'll just hold off until after the
official release.

rday
-------------- next part --------------
diff -pru busybox/networking/interface.c busybox.new/networking/interface.c
--- busybox/networking/interface.c	2006-06-26 06:57:30.000000000 -0400
+++ busybox.new/networking/interface.c	2006-06-26 07:52:57.000000000 -0400
@@ -723,13 +723,16 @@ struct hwtype {
 };
 
 static const struct hwtype unspec_hwtype = {
-	"unspec", "UNSPEC", -1, 0,
-	UNSPEC_print, NULL, NULL
+	.name =		"unspec",
+	.title =	"UNSPEC",
+	.type =		-1,
+	.print =	UNSPEC_print
 };
 
 static const struct hwtype loop_hwtype = {
-	"loop", "Local Loopback", ARPHRD_LOOPBACK, 0,
-	NULL, NULL, NULL
+	.name =		"loop",
+	.title =	"Local Loopback",
+	.type =		ARPHRD_LOOPBACK
 };
 
 #include <net/if_arp.h>
@@ -753,22 +756,35 @@ static char *pr_ether(unsigned char *ptr
 }
 
 static const struct hwtype ether_hwtype = {
-	"ether", "Ethernet", ARPHRD_ETHER, ETH_ALEN,
-	pr_ether, NULL /* UNUSED in_ether */ , NULL
+	.name =		"ether",
+	.title =	"Ethernet",
+	.type =		ARPHRD_ETHER,
+	.alen =		ETH_ALEN,
+	.print =	pr_ether
 };
 
 #include <net/if_arp.h>
 
 static const struct hwtype ppp_hwtype = {
-	"ppp", "Point-Point Protocol", ARPHRD_PPP, 0,
-	NULL, NULL, NULL /* UNUSED do_ppp */ , 0
+	.name =		"ppp",
+	.title =	"Point-to-Point Protocol",
+	.type =		ARPHRD_PPP
 };
 
+static const struct hwtype sit_hwtype = {
+	.name =			"sit",
+	.title = 		"IPv6-in-IPv4",
+	.type = 		ARPHRD_SIT,
+	.print =		UNSPEC_print,
+	.suppress_null_addr =	1
+} ;
+
 static const struct hwtype * const hwtypes[] = {
 	&loop_hwtype,
 	&ether_hwtype,
 	&ppp_hwtype,
 	&unspec_hwtype,
+	&sit_hwtype,
 	NULL
 };
 
Only in busybox.new/networking: interface.c.orig


More information about the busybox mailing list