From nobody Thu May 16 17:11:21 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 4VgGpL1fdtz5LYY3; Thu, 16 May 2024 17:11:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgGpL0tFgz4N1J; Thu, 16 May 2024 17:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715879482; 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=Nyy4qZjxJ8e/1Nmhdq9W7LLHt1fCAaU6S0IFau56C5g=; b=jKVppLBIana2fEo1Ovh1MFU4ixvT8R04+L4Zg/bKLuZOzPuiP9TEFOYe+KMdGiQw347tsP l1wyDaP1E2GcjG3j5PmtLX4SnnhKgREGn6IGTVmRUYR0KI4s2m5OGHSD9hT+H6e2ETGiwF a3xTmvr8KvWfc7QMOl+pzq1CS1FkWJGmn8uyywMDP8FJ5f7OR+GpCJtjhGFbCy176qyYWy PKkDr33wn6BJE0O3ICLO5+gdGiYNGhqS8f2jpP9n0A4/IQHPHA8RX4hdXiMnCNbX6tYwNE 82fSl2VnGa+HAUvsmAU/1Qpkat3a7WDMxcTv0e5oAYwAWl/aGZXyMp6Bf4wfdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715879482; a=rsa-sha256; cv=none; b=asdpyEwIFsjtze6rTzUlnbXHMQhuYFI8gzqQdVr1kyruCJ5xVagTZLrCl8sd/FOltTTTXk YcXM7MZuLQDjKB9QD08kCCSdWXIRSA1UGmv1Nu323qnIuNTiFzqoXWLcDwoclOSJsTBiYl as/GN11PTkcdLeLO5eAvrNWYE7uJlrXr6Brlve1ROjp7heMzr+dyUvlHAIAxJGSc3+A3Vd 0329vL+XCDdhwSmAYNovGi74ffubi0Ita7eGna40d/L4rbqQPFt91B76zg35jaV92S5V8A VbCZrEK70wZdqY7ccxsuyM8+DjmHgqHBlRv+wf6z7FQGz9Zt/GspayLpMS7big== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715879482; 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=Nyy4qZjxJ8e/1Nmhdq9W7LLHt1fCAaU6S0IFau56C5g=; b=tKzeWKvX5ldfjCx6UyEyBvrfclwlXPrfO9PvPTjYxbxB7JhYBJLpa5rakvmVLAY9NpdI1n CcjatIalINd+SWIOhZXx8+sKIRBHDxe4wKCN1kHFoyPXMfWVdCucxD++t+0+m3zxLZ6MVa NRcsemJaYQYXeEkSveiKFm+M+ewOOXz8QCpNUyIS43zckkcLDntrPeqea+lZ8+AEHxUp71 fHolYc6NHU/qY+d7yiWWAp876EvK6DIJz9KAzmoT8vP/p3RvP6+cNqOq2gE9qex4+ukueZ 2blHk5xFMFi4RAUAdAj1JpExgirOPQjgjpM74fXK7lIz18Wr0M+KJ5GIJa4aQQ== 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 4VgGpL0Tmhz16pY; Thu, 16 May 2024 17:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44GHBL6Q034169; Thu, 16 May 2024 17:11:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHBL2O034166; Thu, 16 May 2024 17:11:21 GMT (envelope-from git) Date: Thu, 16 May 2024 17:11:21 GMT Message-Id: <202405161711.44GHBL2O034166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d33b87e8cf91 - main - netstat(1): 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d33b87e8cf91a6bcb5eac0ecc0371c1041c61050 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d33b87e8cf91a6bcb5eac0ecc0371c1041c61050 commit d33b87e8cf91a6bcb5eac0ecc0371c1041c61050 Author: Lexi Winter AuthorDate: 2024-05-08 09:44:29 +0000 Commit: Warner Losh CommitDate: 2024-05-16 17:07:34 +0000 netstat(1): 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 --- 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 f4c76f54a420..1db3c2d37167 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -64,16 +64,15 @@ #include "common.h" /* column widths; each followed by one space */ +#define WID_IF_DEFAULT 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; @@ -415,7 +414,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 6152cbdc859f..93e882052de2 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -184,16 +184,15 @@ pr_family(int af1) } /* column widths; each followed by one space */ +#define WID_IF_DEFAULT 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; @@ -234,7 +233,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; }