[BusyBox-cvs] busybox/networking route.c,1.20,1.21

Robert Griebl sandman at busybox.net
Mon Dec 16 22:04:22 UTC 2002


Update of /var/cvs/busybox/networking
In directory winder:/tmp/cvs-serv13930

Modified Files:
	route.c 
Log Message:
Always print the routing table header for IPv4:
 - this is consistent with IPv6 route
 - you can get very confused, if there are no routes and "route" prints
   nothing at all (not even "No routes" message)


Index: route.c
===================================================================
RCS file: /var/cvs/busybox/networking/route.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- route.c	11 Dec 2002 03:57:12 -0000	1.20
+++ route.c	16 Dec 2002 22:04:18 -0000	1.21
@@ -498,6 +498,11 @@
 	if (noresolve)
 		noresolve = 0x0fff;
 
+	printf("Kernel IP routing table\n");
+	printf
+		("Destination     Gateway         Genmask         Flags %s Iface\n",
+		 netstatfmt ? "  MSS Window  irtt" : "Metric Ref    Use");
+
 	while (fgets(buff, sizeof(buff), fp) != NULL) {
 		if (nl) {
 			int ifl = 0;
@@ -511,12 +516,6 @@
 					   &d, &g, &flgs, &ref, &use, &metric, &m, &mtu, &win,
 					   &ir) != 10) {
 				error_msg_and_die("Unsuported kernel route format\n");
-			}
-			if (nl == 1) {
-				printf("Kernel IP routing table\n");
-				printf
-					("Destination     Gateway         Genmask         Flags %s Iface\n",
-					 netstatfmt ? "  MSS Window  irtt" : "Metric Ref    Use");
 			}
 			ifl = 0;	/* parse flags */
 			if (flgs & RTF_UP) {




More information about the busybox-cvs mailing list