Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Jul 2022 15:21:30 -0500
From:      "Mike Karels" <mike@karels.net>
To:        "Ronald Klop" <ronald-lists@klop.ws>
Cc:        "George Michaelson" <ggm@algebras.org>, freebsd-net@freebsd.org, "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>, "mike tancsa" <mike@sentex.net>, "Chris Ross" <cross+freebsd@distal.com>
Subject:   Re: Netstat -i 5-character interface name length?
Message-ID:  <32225F81-1D08-48C6-8F2A-6F967460B6F8@karels.net>
In-Reply-To: <59381F02-5769-41D2-ACA2-9555829C3338@karels.net>
References:  <0843509a-fe0c-ffe8-2cfe-534872bc33bd@sentex.net> <202206301516.25UFGSrM090126@gndrsh.dnsmgr.net> <CAKr6gn2TpdcWS-J159zPiCM5t=PKKp8gw5jEq7gefLqJ-88zZA@mail.gmail.com> <1823295646.70.1656666667833@localhost> <59381F02-5769-41D2-ACA2-9555829C3338@karels.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2 Jul 2022, at 10:11, Mike Karels wrote:

> On 1 Jul 2022, at 4:11, Ronald Klop wrote:
>
>> Van: George Michaelson <ggm@algebras.org>
>> Datum: vrijdag, 1 juli 2022 00:50
>> Aan: "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
>> CC: mike tancsa <mike@sentex.net>, Chris Ross=20
>> <cross+freebsd@distal.com>, 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=20
>> 5 chars".
>> $ netstat -i | grep Link
>> Name    Mtu Network       Address              Ipkts Ierrs Idrop   =20
>> Opkts Oerrs  Coll
>> genet  1500 <Link#1>      dc:a6:32:da:f4:3b 62095311     0     0=20
>> 105591894     0     0
>> lo0   16384 <Link#2>      lo0                      1     0     0     =20
>>   1     0     0
>> bridg  1500 <Link#3>      58:9c:fc:00:3e:aa 18616989     0     0=20
>> 18652615     8     0
>> vlan3  1500 <Link#4>      dc:a6:32:da:f4:3b  9673278     0     0 =20
>> 5695824     8     0
>> epair  1500 <Link#5>      02:c8:49:24:bd:0a  3041667     0     0 =20
>> 4467006    17     0
>> epair  1500 <Link#7>      02:d5:f0:fe:9e:0a  1529717     0     0 =20
>> 1932170    17     0
>> epair  1500 <Link#9>      02:96:17:58:ce:0a  2384154     0     0 =20
>> 4740683    17     0
>> epair  1500 <Link#11>     02:b2:7f:d6:da:0a     8746     0     0   =20
>> 22125    22     0
>> epair  1500 <Link#17>     02:81:38:75:d1:0a    87264     0     0  =20
>> 178535    21     0
>> epair  1500 <Link#19>     02:ad:f2:49:60:0a    78055     0     0  =20
>> 160252    21     0
>> epair  1500 <Link#21>     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=20
>> solution of "rename all your interfaces" as I think the=20
>> out-of-the-box 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=20
> the
> output makes no sense if names are ambiguous.  This is a trivial=20
> change
> (I just tested it).  Any comments or objections?  I=E2=80=99ll put it i=
n
> review.

It=E2=80=99s https://reviews.freebsd.org/D35703.

		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
>>> <freebsd-rwg@gndrsh.dnsmgr.net> 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
>>> >
>>>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32225F81-1D08-48C6-8F2A-6F967460B6F8>