On Mon, Sep 28, 2015 at 01:02:24PM +0200, Martin Pieuchot wrote: > It seems to me that the recent iwm(4)/if_setlladdr() fix applies to > more (if not all) wireless drivers since the stack keeps its own > copy of the lladdr. Does the diff below make sense? > > I'd also suggest to stop abusing "ac_enaddr" or "ic_myaddr" and use > if_sadl instead. Having 3 copies of the same address is error prone. > > Plus I'd appreciate if we could keep per-driver ioctl routines as small > as possible ;)
I very much agree with the general direction. But I'm not sure what, if anything, would break if we did this. The SIOCSIFLLADDR ioctl path runs iface down/up after changing the MAC. It seems all other wireless drivers update ic_myaddr when they're brought up and pick the stack-side MAC address then. iwm(4) didn't do this. Perhaps some other drivers are subtly broken, eg. iwn(4) was leaking the HW MAC in probe requests until recently. For now, I've added MAC copying to the ioctl handler in iwm(4) since I think it makes more sense to have it in the ioctl path. I also think we should clean up this up in general and make it consistent, and store the MAC in one place. But that's a larger change than I am ready to handle at the moment.
