From nobody Mon Nov 20 21:23:31 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 4SZ0qh4Wpnz51sFk for ; Mon, 20 Nov 2023 21:23:44 +0000 (UTC) (envelope-from franco@opnsense.org) Received: from mail.opnsense.org (mail.opnsense.org [81.171.24.236]) (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 4SZ0qg5gssz3cvD; Mon, 20 Nov 2023 21:23:43 +0000 (UTC) (envelope-from franco@opnsense.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=opnsense.org header.s=dkim header.b="lkP/kiLS"; spf=pass (mx1.freebsd.org: domain of franco@opnsense.org designates 81.171.24.236 as permitted sender) smtp.mailfrom=franco@opnsense.org; dmarc=pass (policy=quarantine) header.from=opnsense.org Received: from localhost (mail.opnsense.org [127.0.0.1]) by mail.opnsense.org (Postfix) with ESMTP id 8DE3315908E; Mon, 20 Nov 2023 22:23:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.opnsense.org Received: from mail.opnsense.org ([127.0.0.1]) by localhost (mail.opnsense.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GvdRGxsnLkhH; Mon, 20 Nov 2023 22:23:42 +0100 (CET) Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opnsense.org; s=dkim; t=1700515422; bh=7De11QiBGWFaVewGGnACrZJ3dhKmu2iz3N7DtPQpFsg=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=lkP/kiLSrDyXmOVkQSpMRPWuHMKEncS5K2mpGNz0YBfYentQ+a0tZUm4DzU8YrLva LRAfuEa6hQ/OGLGAxyAgyI2+GtcJXMI3LRvD/MtACHWGccW25oe80ZwYszYJOzfzxC f9p+Mk/ez8eiFuZOtMLHsuC5GPdiBPuRqmSxHc2c= 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 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: How to tell if a network interface was renamed (and from what) From: Franco Fichtner In-Reply-To: Date: Mon, 20 Nov 2023 22:23:31 +0100 Cc: Mike Karels , =?utf-8?Q?Mina_Gali=C4=87?= , Zhenlei Huang , Kyle Evans , freebsd-net@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <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> To: Kristof Provost X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[opnsense.org,quarantine]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[opnsense.org:s=dkim]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-net@freebsd.org]; ASN(0.00)[asn:60781, ipnet:81.171.0.0/19, country:NL]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[opnsense.org:+]; TO_DN_SOME(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4SZ0qg5gssz3cvD X-Spamd-Bar: --- 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 = wrote: >=20 >=20 >> On 20. Nov 2023, at 21:56, Kristof Provost wrote: >>=20 >> 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. >=20 > ifconfig_get_orig_name() already exists, but apart from wlandebug > nothing is using it. >=20 > The internally used IFDATA_DRIVERNAME also appears in ifinfo > (not installed in base) and bsnmpd but that's it. >=20 > if_dname is the target and it exists in ifnet struct along with > a man page entry in inet(9). >=20 > All that is really missing is a way to print it via ifconfig command. >=20 >=20 > Cheers, > Franco