diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index 44a9b51a811a..af2382a64dc8 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -1049,7 +1049,7 @@ inet6print(struct in6_addr *in6, int port, char *proto, int numeric) char line[80], *cp; int width; - sprintf(line, "%.*s.", lflag ? 39 : + sprintf(line, "%.*s.", Wflag ? 39 : (Aflag && !numeric) ? 12 : 16, inet6name(in6)); cp = index(line, '\0'); if (!numeric && port) @@ -1058,7 +1058,7 @@ inet6print(struct in6_addr *in6, int port, char *proto, int numeric) sprintf(cp, "%.8s", sp ? sp->s_name : "*"); else sprintf(cp, "%d", ntohs((u_short)port)); - width = lflag ? 45 : Aflag ? 18 : 22; + width = Wflag ? 45 : Aflag ? 18 : 22; printf("%-*.*s ", width, width, line); } diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 30dfaa8040dd..d2242d419c06 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -322,7 +322,6 @@ int bflag; /* show i/f total bytes in/out */ int dflag; /* show i/f dropped packets */ int gflag; /* show group (multicast) routing or stats */ int iflag; /* show interfaces */ -int lflag; /* show routing table with use and ref */ int Lflag; /* show size of listen queues */ int mflag; /* show memory stats */ int numeric_addr; /* show addresses numerically */ @@ -413,9 +412,6 @@ main(argc, argv) case 'i': iflag = 1; break; - case 'l': - lflag = 1; - break; case 'L': Lflag = 1; break; @@ -455,6 +451,7 @@ main(argc, argv) af = AF_UNIX; break; case 'W': + case 'l': Wflag = 1; break; case 'w': diff --git a/usr.bin/netstat/mroute6.c b/usr.bin/netstat/mroute6.c index 16368b8b8640..712e36acae22 100644 --- a/usr.bin/netstat/mroute6.c +++ b/usr.bin/netstat/mroute6.c @@ -88,8 +88,8 @@ #include "netstat.h" -#define WID_ORG (lflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */ -#define WID_GRP (lflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */ +#define WID_ORG (Wflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */ +#define WID_GRP (Wflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */ void mroute6pr(u_long mfcaddr, u_long mifaddr) diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index 3efa21e7f807..eca68c094d22 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -42,7 +42,6 @@ extern int bflag; /* show i/f total bytes in/out */ extern int dflag; /* show i/f dropped packets */ extern int gflag; /* show group (multicast) routing or stats */ extern int iflag; /* show interfaces */ -extern int lflag; /* show routing table with use and ref */ extern int Lflag; /* show size of listen queues */ extern int mflag; /* show memory stats */ extern int numeric_addr; /* show addresses numerically */ diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 4390a2e4f920..e75084d9b162 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -228,9 +228,9 @@ pr_family(int af) #define WID_IF(af) 6 /* width of netif column */ #else #define WID_DST(af) \ - ((af) == AF_INET6 ? (lflag ? 39 : (numeric_addr ? 33: 18)) : 18) + ((af) == AF_INET6 ? (Wflag ? 39 : (numeric_addr ? 33: 18)) : 18) #define WID_GW(af) \ - ((af) == AF_INET6 ? (lflag ? 31 : (numeric_addr ? 29 : 18)) : 18) + ((af) == AF_INET6 ? (Wflag ? 31 : (numeric_addr ? 29 : 18)) : 18) #define WID_IF(af) ((af) == AF_INET6 ? 8 : 6) #endif /*INET6*/ @@ -243,8 +243,8 @@ pr_rthdr(int af) if (Aflag) printf("%-8.8s ","Address"); - if (af == AF_INET || lflag) - if (lflag) + if (af == AF_INET || Wflag) + if (Wflag) printf("%-*.*s %-*.*s %-6.6s %6.6s %8.8s %6.6s %*.*s %6s\n", WID_DST(af), WID_DST(af), "Destination", WID_GW(af), WID_GW(af), "Gateway", @@ -602,9 +602,9 @@ p_rtentry(struct rtentry *rt) p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST, WID_GW(addr.u_sa.sa_family)); p_flags(rt->rt_flags, "%-6.6s "); - if (addr.u_sa.sa_family == AF_INET || lflag) { + if (addr.u_sa.sa_family == AF_INET || Wflag) { printf("%6ld %8ld ", rt->rt_refcnt, rt->rt_use); - if (lflag) { + if (Wflag) { if (rt->rt_rmx.rmx_mtu != 0) printf("%6lu ", rt->rt_rmx.rmx_mtu); else