[BusyBox] route patch

John Tyner jtyner at cs.ucr.edu
Fri Sep 14 12:02:47 UTC 2001


The route command in busybox was only printing the first route. This patch
should fix it. ( At least it did for me. :) )

-- 
John Tyner
jtyner at cs.ucr.edu
-------------- next part --------------
diff -u -r1.1.1.2 route.c
--- route.c	13 Sep 2001 17:17:14 -0000	1.1.1.2
+++ route.c	14 Sep 2001 17:57:34 -0000
@@ -374,13 +374,6 @@
 			   &d, &g, &flgs, &ref, &use, &metric, &m)!=7) {
 				error_msg_and_die( "Unsuported kernel route format\n");
 			}
-			if(nl==1) {
-                printf("Kernel IP routing table\n"
-"Destination     Gateway         Genmask         Flags Metric Ref    Use Iface\n");
-			} else {
-			    nl++;
-			    continue;
-			}
 
 			ifl = 0;        /* parse flags */
 			if(flgs&1)
@@ -401,6 +394,9 @@
 				sdest, sgw,
 				inet_ntoa(mask),
 				flags, metric, ref, use, buff);
+		} else {
+		  printf("Kernel IP routing table\n"
+			 "Destination     Gateway         Genmask         Flags Metric Ref    Use Iface\n");
 		}
 	nl++;
 	}


More information about the busybox mailing list