Date: Wed, 20 Aug 2014 11:43:04 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-hackers@freebsd.org Cc: "Pokala, Ravi" <rpokala@panasas.com>, Ryan Stone <rysto32@gmail.com>, Brooks Davis <brooks@freebsd.org> Subject: Re: Common storage of original MAC address Message-ID: <201408201143.04150.jhb@freebsd.org> In-Reply-To: <D018246A.11C727%rpokala@panasas.com> References: <D0168955.11C3AD%rpokala@panasas.com> <CAFMmRNwDrEY-Z5VP%2B_03-ZGf_6Ye89jCKO-HpfqYAoZjATFAdQ@mail.gmail.com> <D018246A.11C727%rpokala@panasas.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408201143.04150.jhb>