From nobody Tue Oct 08 04:03:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN2SD4mXCz5Yt53; Tue, 08 Oct 2024 04:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN2SD4L1lz4W5m; Tue, 8 Oct 2024 04:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728360204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B2Tg45KjlWCGUkOUXhEfE6tS82M3hfWD44U1Udp+6wo=; b=IfGad6fdpdzaC1LgRrbhJAhdLqM5DDykjWL+pjZGMfTdesyeTJZuTcodij3RXTn//p7au4 BpRL0NybGvZBygb0miFd9bz4KyqxnzMXSIv4Pas2B1LAMQXC6JG/fnbIoY0ILUy/l5lGaW YAe9yLdxiHY8VGxVRPsCM22KaXmwOyVAEeIBZH3p/zR5g6uQ7LXmaz0fznrnWrTMMUfVmC ozHfYAMDcvVBw0BUwRSRjEj+3xbskp8tMGxLII51RiMnNQ5ySN9uXo+pb4CbBtQNfqpmZh EHG15S6fBGcHPI9fKED6gWNxfqLKyoAayUQGut4XXa2xfe4ceBqcqk3j3x080w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728360204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B2Tg45KjlWCGUkOUXhEfE6tS82M3hfWD44U1Udp+6wo=; b=fMR1VAiOqVnodajNDuNWnXxuX4fZ+YLh3rfzDmVMC5dyHgAp80pCuFx9KcKEac+jg1kbHI oO34hKot03z8OhESi3O/brJeK8CaM3cyS+IWvUH7v2E2gqf5+eo2QpfSwPZANRsaeAQr+B SnTKVMuqg9Z/mAx4oduqt4Rq2qKcI+GO/G6qe2Zu+v1wcZjiAonp5deSWErOJUZJNaW77b ry2kmkNx373SJDuK5o3EIa+sIbnGX1DpMEa0JjgE686/JmzzjG2nRSPll0kqbweJLl90Ot fB+ClXDGN+/ZDenWKNRWLRyvWHt7W0VHopS7qGLmTQ7KDaEl+lagd9eTE8G8JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728360204; a=rsa-sha256; cv=none; b=HnSofTblAjLn9RtJNaM8cevbVTKrO7aaNiHvQV8DXBTaDixpNYssXUJh7aWxFlUpA8ln8R k+pbTYV/wVu0fw98a+DN0pijoQVNvIzaUdXcRu3G0iDRC8q9i4RDczadYuSgpox3XADAFQ 3/oCimPhORbBM/f1EsTk0ojXM8FVm28WkYSUGuzqsPVOQcQMivSoAHwbe68UgXXtdy7dQ+ U1i4kyTtiZ8rfj6eYrSizvxHwui9usoxXLA8HxnLbS1FNiyf3JT7jAuQ+f983n0DAzi8gT U5II3RIHFNgDjVYIDx3QWtHvuXaVDhsWy7tQSbRmS6DhlsCHx3wgL286j1J2Ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN2SD3xTjzFRn; Tue, 8 Oct 2024 04:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49843OGp044870; Tue, 8 Oct 2024 04:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49843OhC044867; Tue, 8 Oct 2024 04:03:24 GMT (envelope-from git) Date: Tue, 8 Oct 2024 04:03:24 GMT Message-Id: <202410080403.49843OhC044867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 6b86b8f0f6b6 - stable/14 - netstat: increase width of Netif column List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6b86b8f0f6b6bfd5d93e45c7f584ec5bffac2a62 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6b86b8f0f6b6bfd5d93e45c7f584ec5bffac2a62 commit 6b86b8f0f6b6bfd5d93e45c7f584ec5bffac2a62 Author: Lexi Winter AuthorDate: 2024-05-08 09:44:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-08 04:02:24 +0000 netstat: increase width of Netif column The previous width of Netif (10 or 8) was too short for modern interface names; make it 12, which is long enough to display "epair0a.1000". This came up in practice with genet(4) interfaces, since the base interface name is long enough that with the previous limit, VLAN identifiers would be truncated at 1 character in the IPv6 output: "genet0.100" becomes "genet0.1". The width is now fixed, and doesn't depend on the address family, because there's no reason that length of the interface name would vary based on the AF. Reviewed by: imp,zlei,Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/1223 (cherry picked from commit d33b87e8cf91a6bcb5eac0ecc0371c1041c61050) netstat: for -W, use IFNAMSIZ If -W is specified, use IFNAMSIZ as the width of the Netif column, instead of the default 12. (cherry picked from commit ae9c0ba8ef2f540f9030909cf07e3c59f876fd23) --- usr.bin/netstat/nhops.c | 5 ++--- usr.bin/netstat/route.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index 19a7a6891050..c4412bc68081 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -65,16 +65,15 @@ #include "common.h" /* column widths; each followed by one space */ +#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 */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ static int wid_dst; static int wid_gw; @@ -416,7 +415,7 @@ print_nhops_sysctl(int fibnum, int af) wid_flags = 6; wid_pksent = 8; wid_mtu = 6; - wid_if = WID_IF_DEFAULT(fam); + wid_if = WID_IF_DEFAULT; xo_open_instance("rt-family"); pr_family(fam); xo_open_list("nh-entry"); diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 9096d5f58daf..10d47c6a330e 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -191,16 +191,15 @@ pr_family(int af1) } /* column widths; each followed by one space */ +#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 */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ struct _wid wid; @@ -241,7 +240,7 @@ set_wid(int fam) wid.flags = 6; wid.pksent = 8; wid.mtu = 6; - wid.iface = WID_IF_DEFAULT(fam); + wid.iface = WID_IF_DEFAULT; wid.expire = 6; }