Re: Confusing ifreq behavior: guru needed

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 13 Oct 1998 14:21:15 +0100 (BST)


> hardware address part works like I expect. But the IP address doesn't;
> it's stored in sa_data, offset two bytes. I don't understand why. Here is
> a code pseudo-fragment:

No the IP address isnt offset. If you cast it to the right sockaddr
structure (struct sockaddr_in *) you'll find its got the port first then
the IP address in that structure.

For all address families you cast GIFADDR/SIFADDR to and from the family
specific sockaddr

-
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/