Re: ioctl SIOCGIFADDR bug

Alan Cox (alan@lxorguk.ukuu.org.uk)
Fri, 6 Aug 1999 20:46:23 +0100 (BST)


> My problem turns out to be an apparently undocumented requirement that the
> family type must be set in the buffer for SIOCGIFADDR to work (but not for
> the mask or broadcast commands to work) and if you don't (i.e. all bytes 0)
> it will return the last four bytes of the network card's MAC address but set
> this byte (the 18th, at offset 17) to 1 which will cause it to work the
> next time.

It returns the entire MAC address if you dont. The world has been that way
since 4.2 BSD at least.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/