diff options
author | pamela <pamela@cvs.openbsd.org> | 2020-09-15 20:28:28 +0000 |
---|---|---|
committer | pamela <pamela@cvs.openbsd.org> | 2020-09-15 20:28:28 +0000 |
commit | f448cbbd2bb521dea603de75080a8dfc060c7f0d (patch) | |
tree | 961481ce03964316c643e24fa3d681df8a3545a8 /sbin/route | |
parent | d4ee3cddfe183550f2f68f54a63844adae77affd (diff) |
"Route show" and "netstat -r" provide formatting for routing tables with
sufficient space to display v4 addresses cleanly, but which truncate v6
addresses. The -n flag on each already provides additional column width
for IPv6 addresses. Make this formatting the default.
OK phessler kn
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/show.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c index ee402bf3024..a3ebb7d3f9f 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.114 2018/08/31 15:18:02 yasuoka Exp $ */ +/* $OpenBSD: show.c,v 1.115 2020/09/15 20:28:27 pamela Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -174,28 +174,20 @@ p_rttables(int af, u_int tableid, char prio) * width of destination/gateway column * strlen("fe80::aaaa:bbbb:cccc:dddd@gif0") == 30, strlen("/128") == 4 */ -#define WID_GW(af) ((af) == AF_INET6 ? (nflag ? 30 : 18) : 18) +#define WID_GW(af) ((af) == AF_INET6 ? 30 : 18) int WID_DST(int af) { - if (nflag) - switch (af) { - case AF_MPLS: - return 9; - case AF_INET6: - return 34; - default: - return 18; - } - else - switch (af) { - case AF_MPLS: - return 9; - default: - return 18; - } + switch (af) { + case AF_MPLS: + return 9; + case AF_INET6: + return 34; + default: + return 18; + } } /* |