aboutsummaryrefslogtreecommitdiff
path: root/networking
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 /networking
parent53f133ac33936d25ed1fdfd7cd02098cb5819be8 (diff)
downloadbusybox-be2ae246fb69d903a492adaed7e3b476c7133718.tar.gz
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)
Diffstat (limited to 'networking')
-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 @@
* Foundation; either version 2 of the License, or (at
* your option) any later version.
*
- * $Id: route.c,v 1.20 2002/12/11 03:57:12 andersen Exp $
+ * $Id: route.c,v 1.21 2002/12/16 22:04:18 sandman Exp $
*
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
@@ -498,6 +498,11 @@ void displayroutes(int noresolve, int netstatfmt)
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;
@@ -512,12 +517,6 @@ void displayroutes(int noresolve, int netstatfmt)
&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) {
if (flgs & RTF_REJECT)