From nobody Sun Nov 19 14:34:23 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 4SYCp95Kdbz51rMR for ; Sun, 19 Nov 2023 14:34:41 +0000 (UTC) (envelope-from freebsd@igalic.co) Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) (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 "protonmail.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SYCp92c3xz3Vlm for ; Sun, 19 Nov 2023 14:34:41 +0000 (UTC) (envelope-from freebsd@igalic.co) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igalic.co; s=protonmail2; t=1700404478; x=1700663678; bh=Iu9pRAD9Si8CMtT8N6y74/ItM611SJLM/xSewyRTat8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=B1ZgRVa3BUrYE+fPTRuhV3NOOwnQfpuSWmppfk/JcP1ROMZW0bwIM9wyNfuT/PIDz yq+1RXIMQ/O9NQEcv/KVs1bXKQaFXD7DY6FQal6Q1ja5nO1Lffez0fiEnbwVzAXOXy aINs0piRoLSlJTOq/fWg46krjBT7aYCXMBZ6jOcEg/UTp6EmGGRa9zsarAY3pYc072 5E4Sszb5PGeOR82V+o3nUC2kuAdUNUhCIEN+1AGvq7mTblquRzFgJMyAhPV7dmG4me sL2fg9qN1gN+JH2etjSDu3K5D3E4JU9O/gDtMOSCTQfCdeJJst8sTpBSquXm3rsLNL m8LjsYL5AIHyg== Date: Sun, 19 Nov 2023 14:34:23 +0000 To: Kyle Evans From: =?utf-8?Q?Mina_Gali=C4=87?= Cc: freebsd-net@freebsd.org Subject: Re: How to tell if a network interface was renamed (and from what) Message-ID: In-Reply-To: <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> References: <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> Feedback-ID: 66573723:user:proton 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:62371, ipnet:185.70.40.0/24, country:CH] X-Rspamd-Queue-Id: 4SYCp92c3xz3Vlm > > 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 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. 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. (but again, that's just for physical devices, then again virtual devices re= cord what type of device they are in their group which is essentially the same thing) 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.