Date: Mon, 20 Nov 2023 21:56:05 +0100 From: Kristof Provost <kp@FreeBSD.org> To: Mike Karels <mike@karels.net> Cc: =?utf-8?q?Mina_Gali=C4=87?= <freebsd@igalic.co>, Zhenlei Huang <zlei@FreeBSD.org>, Kyle Evans <kevans@FreeBSD.org>, freebsd-net@freebsd.org Subject: Re: How to tell if a network interface was renamed (and from what) Message-ID: <F2536F44-5C61-4AE3-BEDA-705DD660A8F7@FreeBSD.org> In-Reply-To: <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> References: <pdHC0ObBkAbx2HfFIhWYaB5-dmQDEUzNTWvVVJAuJV7FWdWWeSwybVFD-uyBUxPlqDRpAW7D1aAZsbrTxEj9kqsq7ESgO41srPmS-PcXGqw=@igalic.co> <E5F5F61E-3827-404A-A46F-BBCF45A29A82@FreeBSD.org> <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <ptnVEMJ_x48tdYePN4iYRiEW2vWqwulbEOUJ4dQ1cKGkxNXZPPfdEVHdJKNHFfs2onxNipVZKPwDZZKlDv1peS1Xttim1VitMFsdUiTkAKE=@igalic.co> <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> <rvRLOlpJc9xIf67ZwmZ4Si6TN2VtmIuyuguoQgEk5NTOeqsqkAwB_9KvlMbW6y-npSjCC2lmLVXbD4oIqyKJdDboThcWiehF_hU0L9D6GZc=@igalic.co> <31B38FCE-0B67-4122-A202-568150E971E1@karels.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 20 Nov 2023, at 21:29, Mike Karels wrote: > On 19 Nov 2023, at 15:35, Mina Gali=C4=87 wrote: >> Hi Zhenlei, >> >> >>> Since it is just for physical devices, may I propose to have the driv= er name in their groups ? >>> >>> So an if_ure interface ue0 will look like: >>> >>> ``` >>> ue0: flags=3D1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP>= metric 0 mtu 1500 >>> >>> options=3D60009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,RX= CSUM_IPV6,TXCSUM_IPV6> >>> >>> ether 00:e0:4c:xx:xx:xx >>> media: Ethernet autoselect (1000baseT <full-duplex>) >>> >>> status: active >>> +++ groups: ure >>> nd6 options=3D23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> >>> >>> ``` >>> >>> That does not include the unit number. But could be useful to quickly= get the driver name of physical devices. >>> >> >> Given that currently on FreeBSD the easiest way to tell if something >> is a physical device is by checking the *absence* of groups, this >> would only really be acceptable if we add an "egress" group like >> OpenBSD does, in addition to the driver name. >> >> If we can't do that, then I think Mike's solution with having the >> driver (and unit) as a separate category would be preferable. > > I have a proof of concept that makes the presumed original name > (driver name + unit number) available to ifconfig, which prints > the string with everything else in the standard output format. > I don't think that is the right solution, I believe a similar solution has been proposed before, and it failed to c= ope with things like epair interfaces. I=E2=80=99d look in the direction of just adding a field to struct ifnet = with the original interface name (likely easily done in if_attach()), alo= ng with a new ioctl to retrieve that field. Best regards, Kristof
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F2536F44-5C61-4AE3-BEDA-705DD660A8F7>