From nobody Sat Jul 02 15:11:44 2022 X-Original-To: freebsd-net@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 E1D698A6143 for ; Sat, 2 Jul 2022 15:12:02 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (mail.karels.net [216.160.39.52]) by mx1.freebsd.org (Postfix) with ESMTP id 4LZwXK5mGgz3Mpm for ; Sat, 2 Jul 2022 15:12:01 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (localhost [127.0.0.1]) by mail.karels.net (8.16.1/8.16.1) with ESMTP id 262FBjVZ011521; Sat, 2 Jul 2022 10:11:47 -0500 (CDT) (envelope-from mike@karels.net) Received: from [10.0.2.130] ([10.0.1.1]) by mail.karels.net with ESMTPSA id wFn0DzFgwGL/LAAA4+wvSQ (envelope-from ); Sat, 02 Jul 2022 10:11:45 -0500 From: "Mike Karels" To: "Ronald Klop" Cc: "George Michaelson" , freebsd-net@freebsd.org, "Rodney W. Grimes" , "mike tancsa" , "Chris Ross" Subject: Re: Netstat -i 5-character interface name length? Date: Sat, 02 Jul 2022 10:11:44 -0500 X-Mailer: MailMate (1.13.2r5673) Message-ID: <59381F02-5769-41D2-ACA2-9555829C3338@karels.net> In-Reply-To: <1823295646.70.1656666667833@localhost> References: <0843509a-fe0c-ffe8-2cfe-534872bc33bd@sentex.net> <202206301516.25UFGSrM090126@gndrsh.dnsmgr.net> <1823295646.70.1656666667833@localhost> List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mail.karels.net id 262FBjVZ011521 X-Rspamd-Queue-Id: 4LZwXK5mGgz3Mpm X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mike@karels.net designates 216.160.39.52 as permitted sender) smtp.mailfrom=mike@karels.net X-Spamd-Result: default: False [-0.67 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[mike]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:216.160.39.52]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[karels.net]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; MLMMJ_DEST(0.00)[freebsd-net]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:209, ipnet:216.160.36.0/22, country:US]; MIME_TRACE(0.00)[0:+]; SUSPICIOUS_RECIPS(1.50)[] X-ThisMailContainsUnwantedMimeParts: N On 1 Jul 2022, at 4:11, Ronald Klop wrote: > Van: George Michaelson > Datum: vrijdag, 1 juli 2022 00:50 > Aan: "Rodney W. Grimes" > CC: mike tancsa , Chris Ross=20 > , freebsd-net@freebsd.org > Onderwerp: Re: Netstat -i 5-character interface name length? >> >> Is there a reason (avoid bikeshedding) the field width can't be >> increased to allow the bgeXhexIsVeryLong0 names to work? > > > I agree. I hope POLA is more leaning towards "why does netstat not=20 > print the interface name correctly?" than "my 15 year old script=20 > parsing the output of netstat doesn't understand strings longer than 5=20 > chars". > $ netstat -i | grep Link > Name Mtu Network Address Ipkts Ierrs Idrop =20 > Opkts Oerrs Coll > genet 1500 dc:a6:32:da:f4:3b 62095311 0 0=20 > 105591894 0 0 > lo0 16384 lo0 1 0 0 =20 > 1 0 0 > bridg 1500 58:9c:fc:00:3e:aa 18616989 0 0=20 > 18652615 8 0 > vlan3 1500 dc:a6:32:da:f4:3b 9673278 0 0 =20 > 5695824 8 0 > epair 1500 02:c8:49:24:bd:0a 3041667 0 0 =20 > 4467006 17 0 > epair 1500 02:d5:f0:fe:9e:0a 1529717 0 0 =20 > 1932170 17 0 > epair 1500 02:96:17:58:ce:0a 2384154 0 0 =20 > 4740683 17 0 > epair 1500 02:b2:7f:d6:da:0a 8746 0 0 =20 > 22125 22 0 > epair 1500 02:81:38:75:d1:0a 87264 0 0 =20 > 178535 21 0 > epair 1500 02:ad:f2:49:60:0a 78055 0 0 =20 > 160252 21 0 > epair 1500 02:0d:07:81:b2:0a 1814108 0 0 =20 > 1455889 16 0 > > So all "default" interface names do not fit. I don't like the solution=20 > of "rename all your interfaces" as I think the out-of-the-box=20 > experience can be made better. > I'll vote for enabling -W by default and add an option for backwards=20 > compatibility. -W makes the address field unnecessarily wide for most users, at least if IPv6 is enabled. However, netstat already has code to figure out the required field width to avoid truncating names, which it uses only for -W. I=E2=80=99d suggest that this should be done unconditionally, as= the output makes no sense if names are ambiguous. This is a trivial change (I just tested it). Any comments or objections? I=E2=80=99ll put it in review. Mike > Regards, > Ronald. > > > > > >> I'm not saying "you can alias around this" is bad, but I sense we're >> walking into a world which is where Linux is, with every physical >> device called eth0/1/2 and then "which" device is eth0 becomes a >> question.. >> >> On Fri, Jul 1, 2022 at 1:17 AM Rodney W. Grimes >> wrote: >> > >> > [ Charset UTF-8 unsupported, converting... ] >> > > On 6/29/2022 10:56 AM, Chris Ross wrote: >> > > > Hello folks. ?I just noticed something that I?m sure has been=20 >> true >> > > > forever, but I checked and it?s still true on my 12.3-STABLE=20 >> system. >> > > > >> > > One of the first local mods I do is alias netstat to netstat -W=20 >> for this >> > > reason. e.g. >> > > alias netstat?? netstat -W >> > > >> > > in /etc/csh.cshrc >> > >> > That only fixes it for your interactive csh processes, the >> > original poster had specifically mentioned output from >> > periodic scrips, aka daily iirc. >> > >> > One thing that can be done to mitigate the long vlan >> > dev name (imho the vlan driver should of just named >> > itself much short, like "vl", as most network devices >> > are 2 litter names anyway) is to use the "name" option >> > of ifconfig to give them a better name than the default. >> > >> > ifconfig vlan2 create vlandev em0 vlan 2 name v2 >> > >> > -- >> > Rod Grimes =20 >> rgrimes@freebsd.org >> > >>