summaryrefslogtreecommitdiff
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2022-11-09 18:00:03 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2022-11-09 18:00:03 +0000
commit115cdb436ee6239e8b814dadbcc4ef381e7002b1 (patch)
treee283aa4fbc9f888fe155fa78f6e6021717d2ca3b /usr.bin/netstat
parent3a9958fcf5e78bb634786300ab1364fc9f15d162 (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 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/show.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c
index a9745569eac..d7a1dd3e623 100644
--- a/usr.bin/netstat/show.c
+++ b/usr.bin/netstat/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.59 2022/06/19 13:59:22 claudio Exp $ */
+/* $OpenBSD: show.c,v 1.60 2022/11/09 18:00:02 kn Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -166,9 +166,9 @@ p_rttables(int af, u_int tableid)
/*
* 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)
@@ -178,7 +178,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;
}