diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2022-11-09 18:00:03 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2022-11-09 18:00:03 +0000 |
commit | 115cdb436ee6239e8b814dadbcc4ef381e7002b1 (patch) | |
tree | e283aa4fbc9f888fe155fa78f6e6021717d2ca3b /sbin/route | |
parent | 3a9958fcf5e78bb634786300ab1364fc9f15d162 (diff) |
ndp, route, netstat: adjust ipv6 address width
It has been annoying me for too long that fully specififed GUAs
(2001:0db8:3333:4444:5555:6666:7777:8888) mess up alignment.
systat(1)'s netstat is the only view that has a big enough limit and thus
never misaligns.
Unify ndp(8), route(8) and netstat(1) views to always align nicely.
Feedback OK claudio
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/show.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c index aac7844c7be..1b1a695a7c2 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.120 2022/06/19 13:59:22 claudio Exp $ */ +/* $OpenBSD: show.c,v 1.121 2022/11/09 18:00:02 kn Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -220,9 +220,9 @@ p_rttables(int af, u_int tableid, char prio) /* * column widths; each followed by one space * width of destination/gateway column - * strlen("fe80::aaaa:bbbb:cccc:dddd@gif0") == 30, strlen("/128") == 4 + * strlen("2001:0db8:3333:4444:5555:6666:7777:8888") == 39 */ -#define WID_GW(af) ((af) == AF_INET6 ? 30 : 18) +#define WID_GW(af) ((af) == AF_INET6 ? 39 : 18) int WID_DST(int af) @@ -232,7 +232,8 @@ WID_DST(int af) case AF_MPLS: return 9; case AF_INET6: - return 34; + /* WID_GW() + strlen("/128") == 4 */ + return 43; default: return 18; } |