From nobody Sun Nov 19 17:49:33 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 4SYJ7B6t8zz516LP for ; Sun, 19 Nov 2023 17:49:42 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4SYJ7B62cJz4MLq; Sun, 19 Nov 2023 17:49:42 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700416182; 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=1lFw9xypKAEAtFDnR0lA/75xv79agw3HucyXNG5enJE=; b=PcMDZtE4LuD1+3qQahRbO8sGQXhVlbdqA+3YNGtLeAWOqgZjLBS0Koo9D8aDK5bjx/IoHD 8u2OCB63X4kSte24Qwn1/D5nee9myhjaAXONy8MspTUowm2mLcI3tqMEL3Sga7HostpzyV 3z2NyLExc8NtJ9iz8yfbAFjdxdbJ3DrPgo6BHgxSXMSYT3urOt0thvKBIIt0G1y0IPEpR3 7HXK5PI6Gpm4Lev9GmZrsDtawpIZQxWNKYVhV0CwOWTEOjGRw0SbSCn7MYNL8sDL2Ah4L4 JXOD7XxAVS1EPxEj8ig8dTdmIsMsXFyys7IM9oP6P17HEqr7GJxackhqVdWmMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700416182; 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=1lFw9xypKAEAtFDnR0lA/75xv79agw3HucyXNG5enJE=; b=vsjzj9mivrpjbkjRvxLPNCnxxPTkelxwWog2CXi4YFbb8QbZo0BpGUJ6/WLkr0tJfLfFRN lH79bvkKy9560wxWpNlwlKcDBF+aFXvU5lKbtgcfKiHEIZHw7TjkXFUAwc8Ic54lXyT7sj UMRiVaJ5raD2FNAN4+2pTTqVKT/7Df7uu73WwfLoGagHHn284OoeqkjSOMowTfAoL5MD1S sVlUoFV62MvMxR4eldeBHKBDXOKJ0+NzI3RCvU0aEqec+jhLRmPv1TPTOGHWQLJuzO/jPx SSwuky06myNb/NMFF4LVPnuI7KQLcOuG8kkWT9TqJJh8v1VuxlWPrOwm+UMzdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700416182; a=rsa-sha256; cv=none; b=kiAKB01uAc34AcU7fM3i5b+scjs5yQIW6h8jTx2D6VtzKJAo8ZLP7MS0jvlBKyUWb6pGXw 0uy+89NlsXB8n/Ddw4SH+mTXIiI5kheIIGN3JhGYs57ailNTCCXxNX95mB6PCzKE928nAf rLxNF6hf6SOoeVHiKmzzhu+q5BHWOg9MwE2O3OwhyQI6VbMaf0SYS132hkI+3G+YwISBUk SuU9uay+QppBFdI/LbSCxT0lmw4QsWjpdrGSbhX11CloWIm4WSAvE8PcW2W0z9uWGuAya5 fF8TJuWWqq+7QDGLHPVmWlpU4PfAGQA09bVkRsRqxLZ3svgGS4hdM20IBM369w== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4SYJ793Kh0z1R02; Sun, 19 Nov 2023 17:49:41 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=utf-8 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 \(3696.120.41.1.4\)) Subject: Re: How to tell if a network interface was renamed (and from what) From: Zhenlei Huang In-Reply-To: Date: Mon, 20 Nov 2023 01:49:33 +0800 Cc: Kyle Evans , freebsd-net@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> References: <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> To: =?utf-8?Q?Mina_Gali=C4=87?= X-Mailer: Apple Mail (2.3696.120.41.1.4) > On Nov 19, 2023, at 10:34 PM, Mina Gali=C4=87 = wrote: >=20 >=20 >=20 >>> FreeBSD currently does not preserve the old ( original ) name of >>> interfaces if it is renamed ( either physical or cloned ones ). >>> While there's an attempt https://reviews.freebsd.org/D28247 >>> to get the device name (physical >>> ones) but it is not perfect and not completed. >>>=20 >>> So may I ask why you need to know if a network interface was renamed = ? >>=20 >>=20 >> Just last week I found this quite a pain as well; once an interface = has >> been renamed, if it's not a pseudo-interface with an obvious group >> there's no clear way, AFAICT, to determine which driver created it >=20 > I think the main reason that we need to know if and from what an = interface has been renamed is if we need to know what driver we're = working with. >=20 > But given that a rename doesn't change =E2=80=94 or even just *alias* > the sysctl dev hierarchy, where a %driver is recorded, we can't > track it back. >=20 > (but again, that's just for physical devices, then again virtual = devices record what type of device they are in their group which > is essentially the same thing) Since it is just for physical devices, may I propose to have the driver = 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. >=20 > As soon as we have more than one interface with different drivers > it's impossible to parse out what we're dealing with without > parsing rc.conf, logs, or worse things I can't think of right now. >=20 >=20 >=20 >=20 >=20