Re: [PATCH] Add MAC address randomization functionality

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2019-04-23 at 12:39 -0700, Eric Caruso wrote:
> On Mon, Apr 22, 2019 at 5:42 PM Dan Williams <dcbw@xxxxxxxxxx> wrote:
> > On Mon, 2019-04-22 at 15:58 -0700, Eric Caruso wrote:
> > > Add two D-Bus methods:
> > > * EnableMACAddressRandomization: (ay : mask) -> nothing
> > > * DisableMACAddressRandomization: nothing -> nothing
> > 
> > I'd almost rather see a single method call, like
> > SetMACAddressRandomization(ay : mask) -> nothing where a zero-
> > length
> > mask means disabling randomization (since it appears a mask is
> > required?)
> > 
> > But also, is a mask really required? Can't we just pick a suitable
> > default (and allow len(mask)==0) and only if the user wants a
> > different
> > behavior, then they have to pass a full mask?
> 
> I'm afraid I don't really understand what you mean here. Are you
> suggesting a single method with three possible effects, where a 6-
> byte
> mask enables randomization with that mask exactly, a 0-length mask
> enables randomization with a default mask (say, keeping the OUI and
> randomizing the rest), and no argument to disable randomization?
> 
> I think this sort of API design makes it really hard to understand
> what's going on and how to use it correctly, personally...

I was sort-of getting at this as a perfect example of a *property* on
the Interface object, not a method. The object should just have a
"MACAddressRandomization" property that you can use the standard D-Bus
Properties interface to get & set. We have a lot of those already.

The downside of properties is that in some language bindings you cannot
receive errors from the Get & Set operations, but those language
bindings are kinda broken.

So yes, while having these as method calls works, and (as I had
suggested) a single method call is perhaps less desirable, the best-
case for this is a property. Any time there's a get/set pattern, or an
enable/disable pattern, that begs for a property.

Dan

> > Dan
> 
> _______________________________________________
> Hostap mailing list
> Hostap@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/hostap


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux