From nobody Tue Nov 21 09:51:17 2023 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 4SZKQQ1kF7z51HBQ for ; Tue, 21 Nov 2023 09:51:26 +0000 (UTC) (envelope-from SRS0=dl4N=HC=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int-backup.realworks.nl (smtp-relay-int-backup.realworks.nl [87.255.56.188]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4SZKQP3MTvz4fdY; Tue, 21 Nov 2023 09:51:25 +0000 (UTC) (envelope-from SRS0=dl4N=HC=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Received: from rwvirtual137.colo.realworks.nl (rwvirtual137.colo.realworks.nl [10.0.10.37]) by mailrelayint1.colo2.realworks.nl (Postfix) with ESMTP id 4SZKQF29qgzmy; Tue, 21 Nov 2023 10:51:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1700560277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YKKboMnLFd9gTF90bnZ7NLECtrXs2Axyl4vj3cbB24w=; b=d5cgeaKRnP0GaCccEmOnvgmhu9ViKmZXmYzWbSwf1BUq2cBHSE+9UlXrw4cv+0rPES37v5 bCUvmANTghfJOwp4LrvINnIDchdtjrBKOOVsK7C8JHzHeVXo2T7JlkNbG47hTNCMhETsKX LX3rM0id8pqss8sBMgOUkktZlqnmEyp5Hr8z7hqp7GeoHFo1nMu1Z57E/Nj++KN8aEoZCY A2Xj9sj45iK5PvHwY6Xz/D2qnNeHlCsn6mGuQ/olhJzi4aNXT0aLSNOY/CBhtrxWLk6zw7 24gj4L0GS5ID677HPKLN7Z7hKsoNCk6GQzcNS/+8amJDNWsFIH0HREPfdVoqmw== Received: from rwvirtual137.colo.realworks.nl (localhost [127.0.0.1]) by rwvirtual137.colo.realworks.nl (Postfix) with ESMTP id 2E2C01C0C97; Tue, 21 Nov 2023 10:51:17 +0100 (CET) Date: Tue, 21 Nov 2023 10:51:17 +0100 (CET) From: Ronald Klop To: Franco Fichtner Cc: freebsd-net@freebsd.org, Kyle Evans , Kristof Provost , Mike Karels , Zhenlei Huang , =?UTF-8?Q?Mina_Gali=C4=87?= Message-ID: <1675481257.73541.1700560277016@localhost> In-Reply-To: <12724698-9B26-4CC2-BDBE-8142675BA4A7@opnsense.org> References: <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> <12724698-9B26-4CC2-BDBE-8142675BA4A7@opnsense.org> Subject: Re: How to tell if a network interface was renamed (and from what) 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: multipart/alternative; boundary="----=_Part_73539_964470319.1700560276913" X-Mailer: Realworks (679.16) X-Originating-Host: from (84-105-120-103.cable.dynamic.v4.ziggo.nl [84.105.120.103]) by rwvirtual137 [10.0.10.37] with HTTP; Tue, 21 Nov 2023 10:51:17 +0100 Importance: Normal X-Priority: 3 (Normal) X-Originating-User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:38930, ipnet:87.255.32.0/19, country:NL] X-Rspamd-Queue-Id: 4SZKQP3MTvz4fdY ------=_Part_73539_964470319.1700560276913 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Interesting. Is this: /usr/src/tools/tools/ifinfo ? Regards, Ronald. =20 Van: Franco Fichtner Datum: maandag, 20 november 2023 22:23 Aan: Kristof Provost CC: Mike Karels , "Mina Galic" , Zhenle= i Huang , Kyle Evans , freebsd-net@fr= eebsd.org Onderwerp: Re: How to tell if a network interface was renamed (and from wha= t) >=20 > FWIW, here is the relevant ifinfo output of a sample machine: >=20 > # ifinfo | grep ^Interface > Interface igb0 (igb0): > Interface igb1 (igb1): > Interface igb2 (igb2): > Interface igb3 (igb3): > Interface enc0 (enc0): > Interface lo0 (lo0): > Interface pflog0 (pflog0): > Interface pfsync0 (pfsync0): > Interface lagg0 (lagg0): > Interface igb2_vlan42 (vlan0): > Interface vlan0.1.23 (vlan1): > Interface vlan0.3 (vlan2): > Interface vlan0.5.6.7 (vlan3): > Interface vlan01. (vlan4): > Interface vlan06 (vlan5): > Interface vlan08 (vlan6): > Interface qinq0.123 (vlan7): > Interface gre2 (gre2): > Interface gre0 (gre0): > Interface gif4 (gif4): > Interface gif1 (gif1): > Interface gif0 (gif0): > Interface l2tp0 (ng0): > Interface bridge0 (bridge0): > Interface lo1 (lo1): > Interface lo2 (lo2): > Interface ovpns2 (tap2): > Interface ovpnc1 (tun1): > Interface ovpnc3 (tun3): > Interface ovpns4 (tun4): > Interface wg0 (wg0): > Interface wg1 (wg1): >=20 > > On 20. Nov 2023, at 22:16, Franco Fichtner wrote: > > > > > >> On 20. Nov 2023, at 21:56, Kristof Provost wrote: > >> > >> I=E2=80=99d look in the direction of just adding a field to struct ifn= et with the original interface name (likely easily done in if_attach()), al= ong with a new ioctl to retrieve that field. > > > > ifconfig_get_orig_name() already exists, but apart from wlandebug > > nothing is using it. > > > > The internally used IFDATA_DRIVERNAME also appears in ifinfo > > (not installed in base) and bsnmpd but that's it. > > > > if_dname is the target and it exists in ifnet struct along with > > a man page entry in inet(9). > > > > All that is really missing is a way to print it via ifconfig command. > > > > > > Cheers, > > Franco >=20 > =20 >=20 >=20 >=20 =20 ------=_Part_73539_964470319.1700560276913 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Interesting.

Is this: /usr/src/tools/tools/ifinfo ?

Regards,
Ronald.
 

Van: Franco Fichtner <franco@opnsense.org>
Datum: maandag, 20 november 2023 22:23
Aan: Kristof Provost <kp@FreeBSD.org>
CC: Mike Karels <mike@karels.net>, "Mina Galic" <= freebsd@igalic.co>, Zhenlei Huang <zlei@FreeBSD.org>, Kyle Evans &= lt;kevans@FreeBSD.org>, freebsd-net@freebsd.org
Onderwerp: Re: How to tell if a network interface was rena= med (and from what)

FWIW, here is the relevant ifinfo= output of a sample machine:

# ifinfo | grep ^Interface
Interface igb0 (igb0):
Interface igb1 (igb1):
Interface igb2 (igb2):
Interface igb3 (igb3):
Interface enc0 (enc0):
Interface lo0 (lo0):
Interface pflog0 (pflog0):
Interface pfsync0 (pfsync0):
Interface lagg0 (lagg0):
Interface igb2_vlan42 (vlan0):
Interface vlan0.1.23 (vlan1):
Interface vlan0.3 (vlan2):
Interface vlan0.5.6.7 (vlan3):
Interface vlan01. (vlan4):
Interface vlan06 (vlan5):
Interface vlan08 (vlan6):
Interface qinq0.123 (vlan7):
Interface gre2 (gre2):
Interface gre0 (gre0):
Interface gif4 (gif4):
Interface gif1 (gif1):
Interface gif0 (gif0):
Interface l2tp0 (ng0):
Interface bridge0 (bridge0):
Interface lo1 (lo1):
Interface lo2 (lo2):
Interface ovpns2 (tap2):
Interface ovpnc1 (tun1):
Interface ovpnc3 (tun3):
Interface ovpns4 (tun4):
Interface wg0 (wg0):
Interface wg1 (wg1):

> On 20. Nov 2023, at 22:16, Franco Fichtner <franco@opnsense.org>= wrote:
>
>
>> On 20. Nov 2023, at 21:56, Kristof Provost <kp@FreeBSD.org> = wrote:
>>
>> 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())= , along with a new ioctl to retrieve that field.
>
> ifconfig_get_orig_name() already exists, but apart from wlandebug
> nothing is using it.
>
> The internally used IFDATA_DRIVERNAME also appears in ifinfo
> (not installed in base) and bsnmpd but that's it.
>
> if_dname is the target and it exists in ifnet struct along with
> a man page entry in inet(9).
>
> All that is really missing is a way to print it via ifconfig command.<= br> >
>
> Cheers,
> Franco

 


  ------=_Part_73539_964470319.1700560276913--