On Tue, 2008-12-09 at 14:17 -0500, Steve Dickson wrote: > > Steinar H. Gunderson wrote: > > On Mon, Dec 08, 2008 at 05:55:40PM -0500, Steve Dickson wrote: > >> Yes... one does pass pointers of struct sockaddr to the majority > >> of the network system call such as bind().. but conventionally > >> I've seen a lot of declare struct sockaddr as memory then typecasting > >> that memory into a struct sockaddr_in pointer... > > > > That's just wrong. Don't do that :-) (Where have you seen this, by the way?) > I believe all over the RPC code in the glibc... for one place... > I have not looked at that code for a while so maybe I have > it backwards... No. That sounds correct. struct sockaddr as defined both in the kernel and in glibc deliberately contains 14 bytes of padding. The struct sockaddr_in is padded so that it is exactly the same size as struct sockaddr. They are not, however, large enough to contain a struct sockaddr_in6. Cheers Trond -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html