From ae9c0ba8ef2f540f9030909cf07e3c59f876fd23 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Wed, 15 May 2024 00:40:32 +0100 Subject: [PATCH] netstat(8): for -W, use IFNAMSIZ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If -W is specified, use IFNAMSIZ as the width of the Netif column, instead of the default 12. Reviewed by: imp,zlei,Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/1223 --- usr.bin/netstat/nhops.c | 2 +- usr.bin/netstat/route.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index 1db3c2d3716..1a5d8eee74b 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -64,7 +64,7 @@ #include "common.h" /* column widths; each followed by one space */ -#define WID_IF_DEFAULT 12 /* width of netif column */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 93e882052de..482fb07ff95 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -184,7 +184,7 @@ pr_family(int af1) } /* column widths; each followed by one space */ -#define WID_IF_DEFAULT 12 /* width of netif column */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */