summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2001-06-11 17:32:53 +0000
committerume <ume@FreeBSD.org>2001-06-11 17:32:53 +0000
commited4c1f2911068c3845f1beeb181de5bcde5d6e7b (patch)
tree0ed87f06bf75bb5ffd5ec19dec55fc3bd389a059 /usr.bin/netstat
parent86b7e548abe9b6b107b4747111ff5469096d79ce (diff)
downloadFreeBSD-src-ed4c1f2911068c3845f1beeb181de5bcde5d6e7b.zip
FreeBSD-src-ed4c1f2911068c3845f1beeb181de5bcde5d6e7b.tar.gz
Add missing column for Mtu in header when -rl is specified.
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/route.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 72b48ec..11e49b6 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -232,11 +232,13 @@ pr_family(af)
#ifndef INET6
#define WID_DST(af) 18 /* width of destination column */
#define WID_GW(af) 18 /* width of gateway column */
+#define WID_IF(af) 6 /* width of netif column */
#else
#define WID_DST(af) \
((af) == AF_INET6 ? (lflag ? 39 : (nflag ? 33: 18)) : 18)
#define WID_GW(af) \
((af) == AF_INET6 ? (lflag ? 31 : (nflag ? 29 : 18)) : 18)
+#define WID_IF(af) ((af) == AF_INET6 ? 8 : 6)
#endif /*INET6*/
/*
@@ -250,10 +252,17 @@ pr_rthdr(af)
if (Aflag)
printf("%-8.8s ","Address");
if (af == AF_INET || lflag)
- printf("%-*.*s %-*.*s %-6.6s %6.6s%8.8s %8.8s %6s\n",
- WID_DST(af), WID_DST(af), "Destination",
- WID_GW(af), WID_GW(af), "Gateway",
- "Flags", "Refs", "Use", "Netif", "Expire");
+ if (lflag)
+ printf("%-*.*s %-*.*s %-6.6s %6.6s%8.8s %5.5s %*.*s %6s\n",
+ WID_DST(af), WID_DST(af), "Destination",
+ WID_GW(af), WID_GW(af), "Gateway",
+ "Flags", "Refs", "Use", "Mtu",
+ WID_IF(af), WID_IF(af), "Netif", "Expire");
+ else
+ printf("%-*.*s %-*.*s %-6.6s %6.6s%8.8s %8.8s %6s\n",
+ WID_DST(af), WID_DST(af), "Destination",
+ WID_GW(af), WID_GW(af), "Gateway",
+ "Flags", "Refs", "Use", "Netif", "Expire");
else
printf("%-*.*s %-*.*s %-6.6s %8.8s %6s\n",
WID_DST(af), WID_DST(af), "Destination",
OpenPOWER on IntegriCloud