From nobody Mon Nov 20 22:06:53 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 4SZ1nW6cjxz5195d for ; Mon, 20 Nov 2023 22:06:55 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SZ1nW5tmdz4JTW; Mon, 20 Nov 2023 22:06:55 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.17.1/8.17.1) with ESMTP id 3AKM6s8O073156; Mon, 20 Nov 2023 16:06:54 -0600 (CST) (envelope-from mike@karels.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karels.net; s=mail2; t=1700518015; bh=rQ/MpVBosWe1dfORxpp7M28No4agPhDNvxL+mFWBxVk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EVU31CDmC3eUnP1TkAgj4wE+t4+m8Bp01RaTk9IvbdYXJpsfCZs5r2uc/UmghrRw0 OUMWE65fKBKzYcHQiwDb79tYFTJYuLKq+9w4mms/gEqQLJtUVZgRGQhoizJDQnagek rJoZaS3rkZGp0pfqKKaj63fDQ76Fjhq6qjrDYjelxh7anHb2hfgeb2hUKQV3yEzkbn cdDTtT6lyCIRtsf6STduC+OmlU4hSKbHEypcMoXWDHI5nz5F/x5YXfQ3Bjgbd/yN2F HNFeyWzi+SoV3sKIRah9YT0CDRap1mGuw3Qa7aW6VBqY4mxVoMIjW0lMoLS3hE7dfd CLWyUUQ7M5X/Q== Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id YD+nKn7YW2XCHQEAs/W3XQ (envelope-from ); Mon, 20 Nov 2023 16:06:54 -0600 From: Mike Karels To: Franco Fichtner Cc: Kristof Provost , =?utf-8?q?Mina_Gali=C4=87?= , Zhenlei Huang , Kyle Evans , freebsd-net@freebsd.org Subject: Re: How to tell if a network interface was renamed (and from what) Date: Mon, 20 Nov 2023 16:06:53 -0600 X-Mailer: MailMate (1.14r5964) Message-ID: In-Reply-To: References: <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> 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 Content-Transfer-Encoding: quoted-printable 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:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Queue-Id: 4SZ1nW5tmdz4JTW On 20 Nov 2023, at 15: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()), = along with a new ioctl to retrieve that field. > > ifconfig_get_orig_name() already exists, but apart from wlandebug > nothing is using it. Thanks for pointing that out! I hadn't noticed it. I also hadn't though= t of that way to fetch the driver name and unit. > 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. That is trivial to add; I just tested it. It also has problems with epair. Maybe that isn't an issue for this purpose. I hate to invent something new when there is something already existing that solves most of the problem. Mike > Cheers, > Franco