On 2017-08-03 13:17, Axel Dörfler wrote:
Am 03/08/2017 um 20:08 schrieb kallisti5:
+ if ((flags & (IFF_UP | IFF_LINK | IFF_CONFIGURING)) == IFF_LINK)Wait... am I crazy or does this not make sense?
+ return kStatusLinkNoConfig;
this: X & (IFF_UP | IFF_LINK | IFF_CONFIGURING) == IFF_LINK
reduces to this: X & (IFF_LINK) == IFF_LINK
Masking for IFF_UP and IFF_CONFIGURING doesn't really do anything.
Maybe you meant:
X & (IFF_UP | IFF_LINK | IFF_CONFIGURING) != 0 ?
No, I'm afraid you are crazy, indeed ;-)
The above check makes sure that out of the given flags, only IFF_LINK
is set, but not the other two.