aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griebl <griebl@gmx.de>2002-12-16 22:04:18 +0000
committerRobert Griebl <griebl@gmx.de>2002-12-16 22:04:18 +0000
commitbe2ae246fb69d903a492adaed7e3b476c7133718 (patch)
tree593c0b78c6bfc620071d23b8f199c60112b34f2e
parent53f133ac33936d25ed1fdfd7cd02098cb5819be8 (diff)
downloadbusybox-w32-be2ae246fb69d903a492adaed7e3b476c7133718.tar.gz
busybox-w32-be2ae246fb69d903a492adaed7e3b476c7133718.tar.bz2
busybox-w32-be2ae246fb69d903a492adaed7e3b476c7133718.zip
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)
-rw-r--r--networking/route.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/networking/route.c b/networking/route.c
index 8117b0397..b564c6dcd 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -15,7 +15,7 @@
15 * Foundation; either version 2 of the License, or (at 15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version. 16 * your option) any later version.
17 * 17 *
18 * $Id: route.c,v 1.20 2002/12/11 03:57:12 andersen Exp $ 18 * $Id: route.c,v 1.21 2002/12/16 22:04:18 sandman Exp $
19 * 19 *
20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> 20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
21 * adjustments by Larry Doolittle <LRDoolittle@lbl.gov> 21 * adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
@@ -498,6 +498,11 @@ void displayroutes(int noresolve, int netstatfmt)
498 if (noresolve) 498 if (noresolve)
499 noresolve = 0x0fff; 499 noresolve = 0x0fff;
500 500
501 printf("Kernel IP routing table\n");
502 printf
503 ("Destination Gateway Genmask Flags %s Iface\n",
504 netstatfmt ? " MSS Window irtt" : "Metric Ref Use");
505
501 while (fgets(buff, sizeof(buff), fp) != NULL) { 506 while (fgets(buff, sizeof(buff), fp) != NULL) {
502 if (nl) { 507 if (nl) {
503 int ifl = 0; 508 int ifl = 0;
@@ -512,12 +517,6 @@ void displayroutes(int noresolve, int netstatfmt)
512 &ir) != 10) { 517 &ir) != 10) {
513 error_msg_and_die("Unsuported kernel route format\n"); 518 error_msg_and_die("Unsuported kernel route format\n");
514 } 519 }
515 if (nl == 1) {
516 printf("Kernel IP routing table\n");
517 printf
518 ("Destination Gateway Genmask Flags %s Iface\n",
519 netstatfmt ? " MSS Window irtt" : "Metric Ref Use");
520 }
521 ifl = 0; /* parse flags */ 520 ifl = 0; /* parse flags */
522 if (flgs & RTF_UP) { 521 if (flgs & RTF_UP) {
523 if (flgs & RTF_REJECT) 522 if (flgs & RTF_REJECT)