From nobody Tue Nov 21 13:46:12 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 4SZQdT0M2Vz51fht for ; Tue, 21 Nov 2023 13:46:21 +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 4SZQdS5cDBz3ckX; Tue, 21 Nov 2023 13:46:20 +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 3ALDkDVg077237; Tue, 21 Nov 2023 07:46:13 -0600 (CST) (envelope-from mike@karels.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karels.net; s=mail2; t=1700574373; bh=U9nTPMLFl7znyD5xrlOTF8JZIS9S8CNVZEeQ8qTiATY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZGy9dkGxTRPa3zQ3clqxkvb1rCwLR3UdcMGSvWd/kj0EKrojwear/z5dlynrQh8qW Og3dSl9qYJ9vnmkKfvtW5ZSvM7CPM88sMEalsCiOyymrkR6APfLc8dFUmapE8hvzKa 5rAPcSiCGvSyY9Fj1ca2OQI1wZqNvu5reRFktjQBNONbBfMffrU85WszlZiNHILffQ WDtmPEe0I6AhU3LTDXYRQuGPpw0jkEERzT7BfKFpa9CfZlVJpIy3TeiSo7SyjyKNzE hKarTDr1TLlVthD8GkkmUox/v2lT2HLV4vwwHuVv8oPT0Y5oLVKVfACbvhdRDuZaKx xWKlK3D6+t4xw== Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id LSeXGqW0XGWzLQEAs/W3XQ (envelope-from ); Tue, 21 Nov 2023 07:46:13 -0600 From: Mike Karels To: Franco Fichtner Cc: Kristof Provost , =?utf-8?q?Mina_Gali=C4=87?= , freebsd-net@freebsd.org Subject: Re: How to tell if a network interface was renamed (and from what) Date: Tue, 21 Nov 2023 07:46:12 -0600 X-Mailer: MailMate (1.14r5964) Message-ID: In-Reply-To: <3081C679-F5AC-4610-BC6B-00ADA5DC17E7@opnsense.org> References: <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> <3081C679-F5AC-4610-BC6B-00ADA5DC17E7@opnsense.org> 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 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: 4SZQdS5cDBz3ckX On 21 Nov 2023, at 0:43, Franco Fichtner wrote: >> On 20. Nov 2023, at 23:06, Mike Karels wrote: >> >> On 20 Nov 2023, at 15:16, Franco Fichtner wrote: >> >>> 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. > > Two things to consider: > > Does epair do it the "right way"? And does it even matter given that this > behaviour hasn't had any exposure and is likely ever going to be used > as input for another tool? epair arguably does it wrong; it doesn't follow the convention of using the driver name followed by an integer. However, what it does is practical, and clearly we don't want to change it now. Using the driver name as returned by ifconfig_get_orig_addr displays "epair0" for two interfaces. If they have been renamed, the new names will hopefully be suggestive of which is which. Mina, do you care about epair, or is the behavior I described sufficient for your purposes? Mike > I mean it still tracks the origin in the driver. This way you can even find > the epair belonging together. It looks like it should given the design > choices. > > > Cheers, > Franco