Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Nov 2023 13:27:01 -0600
From:      Mike Karels <mike@karels.net>
To:        =?utf-8?q?Mina_Gali=C4=87?= <freebsd@igalic.co>
Cc:        kevans@FreeBSD.org, freebsd-net@freebsd.org
Subject:   Re: How to tell if a network interface was renamed (and from what)
Message-ID:  <1115052A-D72C-4389-979F-5795B1F615BC@karels.net>
In-Reply-To: <B9P4hvvAaJn9M7-aiRmDqTRh460akNFaLIEmn2eRsunzAArKSvzaagrloT_py4Yuk_crTdhC0AsoBVrbMFXPolijnYGKeXatTiRP69GCtrw=@igalic.co>
References:  <pdHC0ObBkAbx2HfFIhWYaB5-dmQDEUzNTWvVVJAuJV7FWdWWeSwybVFD-uyBUxPlqDRpAW7D1aAZsbrTxEj9kqsq7ESgO41srPmS-PcXGqw=@igalic.co> <E5F5F61E-3827-404A-A46F-BBCF45A29A82@FreeBSD.org> <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <ptnVEMJ_x48tdYePN4iYRiEW2vWqwulbEOUJ4dQ1cKGkxNXZPPfdEVHdJKNHFfs2onxNipVZKPwDZZKlDv1peS1Xttim1VitMFsdUiTkAKE=@igalic.co> <99D24919-A5DF-4A8B-882F-9D724AAD494F@karels.net> <B9P4hvvAaJn9M7-aiRmDqTRh460akNFaLIEmn2eRsunzAArKSvzaagrloT_py4Yuk_crTdhC0AsoBVrbMFXPolijnYGKeXatTiRP69GCtrw=@igalic.co>

next in thread | previous in thread | raw e-mail | index | archive | help
On 19 Nov 2023, at 13:13, Mina Gali=C4=87 wrote:

> Hi Mike,
>
>> The kernel has a driver name for each interface, which looks like it
>> doesn't change currently in most cases. There is a kernel accessor
>> function, but I don't think it is exported to user space now. It could=

>> be, though. Would this be sufficient for your purposes? There is also
>> a unit number, which could also be exported.
>
> As mentioned in my initial post, I'm happy to drop to C where alternati=
ves are infeasible, slow, or otherwise cumbersome, or just plain don't ex=
ist.
>
> Here's the code we use to determine boottime: https://github.com/canoni=
cal/cloud-init/blob/5496745b394f9b7b9eaf57fd619330d484ce2da8/cloudinit/ut=
il.py#L2073-L2105

If I would design it right now, I'd add code to ifconfig to exercise the
new feature, and do something like this:

# ifconfig my-interfacename drivername
igb
#

Unit could be done similarly if needed, or ifconfig could have an
operand that caused both driver and unit to be printed, maybe as
two words (hopefully no spaces in driver names!).

		Mike

>
> Mina



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1115052A-D72C-4389-979F-5795B1F615BC>