diff options
author | Robert Griebl <griebl@gmx.de> | 2002-05-16 19:14:15 +0000 |
---|---|---|
committer | Robert Griebl <griebl@gmx.de> | 2002-05-16 19:14:15 +0000 |
commit | c30c5e89cfe9840745a48a50203b3c4fb76c7773 (patch) | |
tree | 603e5ade39ad4435bc3148b51c828bdccc3f82d4 | |
parent | d8636cad4dcc6bc56e9732070683ce1575d92f2c (diff) | |
download | busybox-w32-c30c5e89cfe9840745a48a50203b3c4fb76c7773.tar.gz busybox-w32-c30c5e89cfe9840745a48a50203b3c4fb76c7773.tar.bz2 busybox-w32-c30c5e89cfe9840745a48a50203b3c4fb76c7773.zip |
Reduced code size for new -e flag (suggested by vodz)
-rw-r--r-- | networking/route.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/networking/route.c b/networking/route.c index af630c68b..26162ee87 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.15 2002/05/14 23:03:23 sandman Exp $ | 18 | * $Id: route.c,v 1.16 2002/05/16 19:14:15 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> |
@@ -375,10 +375,8 @@ void displayroutes(int noresolve, int netstatfmt) | |||
375 | } | 375 | } |
376 | if(nl==1) { | 376 | if(nl==1) { |
377 | printf("Kernel IP routing table\n"); | 377 | printf("Kernel IP routing table\n"); |
378 | if ( netstatfmt ) | 378 | printf("Destination Gateway Genmask Flags %s Iface\n", |
379 | printf("Destination Gateway Genmask Flags MSS Window irtt Iface\n"); | 379 | netstatfmt ? " MSS Window irtt" : "Metric Ref Use"); |
380 | else | ||
381 | printf("Destination Gateway Genmask Flags Metric Ref Use Iface\n"); | ||
382 | } | 380 | } |
383 | ifl = 0; /* parse flags */ | 381 | ifl = 0; /* parse flags */ |
384 | if(flgs&RTF_UP) { | 382 | if(flgs&RTF_UP) { |
@@ -408,18 +406,12 @@ void displayroutes(int noresolve, int netstatfmt) | |||
408 | numeric = noresolve | 0x4000; /* host instead of net */ | 406 | numeric = noresolve | 0x4000; /* host instead of net */ |
409 | s_addr.sin_addr = gw; | 407 | s_addr.sin_addr = gw; |
410 | INET_rresolve(sgw, sizeof(sgw), &s_addr, numeric, m); | 408 | INET_rresolve(sgw, sizeof(sgw), &s_addr, numeric, m); |
411 | if ( netstatfmt ) { | 409 | |
412 | printf("%-16s%-16s%-16s%-6s%5d %-5d %6d %s\n", | 410 | printf("%-16s%-16s%-16s%-6s", sdest, sgw, inet_ntoa(mask), flags); |
413 | sdest, sgw, | 411 | if ( netstatfmt ) |
414 | inet_ntoa(mask), | 412 | printf("%5d %-5d %6d %s\n", mtu, win, ir, buff); |
415 | flags, mtu, win, ir, buff); | 413 | else |
416 | } | 414 | printf("%-6d %-2d %7d %s\n", metric, ref, use, buff); |
417 | else { | ||
418 | printf("%-16s%-16s%-16s%-6s%-6d %-2d %7d %s\n", | ||
419 | sdest, sgw, | ||
420 | inet_ntoa(mask), | ||
421 | flags, metric, ref, use, buff); | ||
422 | } | ||
423 | } | 415 | } |
424 | } | 416 | } |
425 | nl++; | 417 | nl++; |