From nobody Wed Nov 22 01:57:31 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 4SZksK31f8z51WRG for ; Wed, 22 Nov 2023 01:57:41 +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 4SZksJ25q6z3MB9; Wed, 22 Nov 2023 01:57:40 +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 3AM1vVkY080352; Tue, 21 Nov 2023 19:57:32 -0600 (CST) (envelope-from mike@karels.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karels.net; s=mail2; t=1700618252; bh=4koCOecbP+wRoWnWC3Xbc3Fnp4Le1uyU86Yco7ToShw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=K/SY8VfDqiOsqwYJxV1SreSf8D0jJk6y6+CLr+Rz8cu99lbwJpjOeh540RRzL9pXw pTdD9AvtvcMSntehkScxNz9OqAtazQPVQin11dNnTgZG2As7sxHkriDl9jT5fOoD00 wJVXRR42xPCXGySn8dLErqmeyko8ojj2jMqPIu7Ez86ZEYa+Dnbs7QDUjEiaHlewPX 0GK8lxUKgwCWKOgBR62obnZ672NkQoV58tgzaLXllxPM/pFITXtk4dkmzNX7eTWVXw HU6jdxSLluGfpx0q/HFaxaFVxZlPRgONo4i/mnPZ3rxy0iba6Pl74dHfc389MaPQxO YfOKGSl9mr+7A== Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id 2R2COgtgXWXeOQEAs/W3XQ (envelope-from ); Tue, 21 Nov 2023 19:57:32 -0600 From: Mike Karels To: Jamie Landeg-Jones Cc: freebsd@igalic.co, zlei@FreeBSD.org, kevans@FreeBSD.org, freebsd-net@FreeBSD.org Subject: Re: How to tell if a network interface was renamed (and from what) Date: Tue, 21 Nov 2023 19:57:31 -0600 X-Mailer: MailMate (1.14r5964) Message-ID: <40C913A3-E5DC-4FC9-9ECE-937370EFD52D@karels.net> In-Reply-To: <202311220135.3AM1Z8ED054659@donotpassgo.dyslexicfish.net> References: <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> <202311220135.3AM1Z8ED054659@donotpassgo.dyslexicfish.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 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: 4SZksJ25q6z3MB9 On 21 Nov 2023, at 19:35, Jamie Landeg-Jones wrote: > Mike Karels wrote: > >> 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, but the other details >> should be easy. I'm tempted to print the driver name and unit >> number separately, although possibly as two words using the same >> option. It should probably be an option rather than a keyword, >> so something like this: >> >> # ifconfig -N interface-name >> igb 1 >> # >> >> Or the unit number could be on a separate option. >> >> Comments? > > I prefer that idea to the use of "groups" (which can be modified anyway), > though in your example, that should be documented as "driver name" not > "interface name", seeing that the returned value is not actually now > the interface name! Here, interface-name was a placeholder for the current name of the interface. My newer code prints "drivername: igb1" at the end of the list of values for "ifconfig $interface-name" or "ifconfig -a" if the -D option is given. I decided that it was better to be able to get all the translations at once (for humans, anyway). Mike > (Similary, if a keyword is decided upon, it should be "driver-name" > not "interface-name") > > I realise that writing "interface-name" was probably just muscle-memory, > but just wanted clarification. > > No opinion on where to display the unit number - whatever works out > better for you. > > Cheers, Jamie