From nobody Mon Nov 20 20:56:05 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 4SZ0Cr5t2Kz51qX3 for ; Mon, 20 Nov 2023 20:56:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SZ0Cr55w3z3Ynp; Mon, 20 Nov 2023 20:56:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700513768; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DgEnZ7jcGUmNaVQSS3eH9LSp1BQcC+/ES81GYM/FHyM=; b=cts4gVAvYAgVoEt/mCakzaB2MD7e/ogeSbOyXD/iFwmqU4WHglWfGahGQfOCuA/z2ARCbF 2XsFGG7SE6iP8IdzbzM4OM3jU1M4j8v0wnS0SiTgGD/tKnqwnkOfbX6WsvRTdrzkcgGXEL zSLcdNSnYIi0Gr5VYsiHl1CNiqvv06td0TpRYSSLZNHX6H9nrWG9FYAJ4H32Q4jNxx5ONH kEzFWWR7R5Ufb/74TqUI/R0z3hkDnDZpBu6Ps31UNHoZZsdBTSCvJiQCvBgXmue5n3CPUh FQKuyEamqwn9+4tVge0LL6Njt/md/lI8PDF2AIiAusUBoKaa28iK+lk+0SK9DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700513768; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DgEnZ7jcGUmNaVQSS3eH9LSp1BQcC+/ES81GYM/FHyM=; b=SjPf0UHf+1fGxoKf+hpox8w++NRRMgtZecGDMUwz7pulOPC48Njlr3kPXWp2sz4DavhP2K zuIsmuVqFvbjlXQryrSIMmRlIb/xlRk7ky/bE7OeJOu5iQxYDoLB67V+Ux+1dDmv4n3ZzN smbnSLWmDWZYQS1BmVIAK7SSBAwn/ql/gZNJKL3tszsfj2LA6pT/GMweVUMwDgGtiotAuQ c3IZAYUgwakLUgl94SDZD/90HUwwl89g/DWACtNE7TRBA48OFy9GFBDuFa0kN85FbnGVzU gU/bjSwktOgyq0HF4rbS15QdbIQtCwvtq7Xv5coZgbELM8E82Nb6WhSO5VRIoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700513768; a=rsa-sha256; cv=none; b=R0p+aKIFrxG2ksgXK64Ai4p9ifsbMZxotM22Oh6f4C1Mj4GlyHgsgfvJQm3xg/lBgeGJD8 HoEBjr8dGkG6bMJW6XX14SYH/qd/AutF/xiuhp0icUHFnzvZIpy0HSCV6WPT24qTzb8Djb sHKLLE9TeScIwc6PsjhIY0DFTzw9aIUyxCunyH+x/82eDPgkb27pQVX0bVv0OcyQ9zCLoK Bkn1fK0TtyjaeSVvQ3v3a5oGSyW1faKrGFwxLOxQHLQkL0dSTR7rM2/AXr0Az2dagaP70A 9Dq8GoNRofRI1InVEq2itw4KMUcWnnKfz8itttGBAcAjCohE5XMk5kwyxyEGHw== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4SZ0Cr3RpXz10SR; Mon, 20 Nov 2023 20:56:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 2D4063D873; Mon, 20 Nov 2023 21:56:06 +0100 (CET) From: Kristof Provost To: Mike Karels Cc: =?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 21:56:05 +0100 X-Mailer: MailMate (1.14r5937) Message-ID: In-Reply-To: <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> 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 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= metric 0 mtu 1500 >>> >>> options=3D60009b >>> >>> ether 00:e0:4c:xx:xx:xx >>> media: Ethernet autoselect (1000baseT ) >>> >>> status: active >>> +++ groups: ure >>> nd6 options=3D23 >>> >>> ``` >>> >>> 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