Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2024 17:11:23 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ae9c0ba8ef2f - main - netstat(8): for -W, use IFNAMSIZ
Message-ID:  <202405161711.44GHBNxH034208@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=ae9c0ba8ef2f540f9030909cf07e3c59f876fd23

commit ae9c0ba8ef2f540f9030909cf07e3c59f876fd23
Author:     Lexi Winter <lexi@le-Fay.ORG>
AuthorDate: 2024-05-14 23:40:32 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-05-16 17:07:34 +0000

    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
---
 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 1db3c2d37167..1a5d8eee74b1 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 93e882052de2..482fb07ff950 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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202405161711.44GHBNxH034208>