netstat(8): for -W, use IFNAMSIZ

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
This commit is contained in:
Lexi Winter 2024-05-15 00:40:32 +01:00 committed by Warner Losh
parent d33b87e8cf
commit ae9c0ba8ef
2 changed files with 2 additions and 2 deletions

View file

@ -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 */

View file

@ -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 */