From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 20 16:00:49 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22D4C8A9; Wed, 20 Aug 2014 16:00:49 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE3B73085; Wed, 20 Aug 2014 16:00:48 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D1478B9D3; Wed, 20 Aug 2014 12:00:47 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Subject: Re: Common storage of original MAC address Date: Wed, 20 Aug 2014 11:43:04 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201408201143.04150.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 20 Aug 2014 12:00:47 -0400 (EDT) Cc: "Pokala, Ravi" , Ryan Stone , Brooks Davis X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Aug 2014 16:00:49 -0000 On Tuesday, August 19, 2014 1:19:02 am Pokala, Ravi wrote: > Or how about an ioctl to get the original MAC (rather than a sysctl). Then > the "restore to default" code would be a two-step process - get the > original MAC with the new ioctl (say "SIOCGHWLLADDR" for "Get Hardware > LLADDR"?), and then set the working MAC to that value w/ the existing > ioctl (SIOCSIFLLADDR). > > I actually like this idea more than the sysctl, because it could be done > in one place (probably in net/if.c, next to if_setlladdr() (which is what > implements the guts of SIOCSIFLLADDR)). > > Does that sound like a plan? I prefer this approach as it preserves the original lladdr as an lladdr rather than a string. You could add something to ifconfig to display the hardware address (perhaps have ifconfig display it by default if it differs from the currently configured MAC) -- John Baldwin