From: Jon G. <jg...@us...> - 2003-02-20 21:26:19
|
Bruce Allan wrote: > > #define _SS_MAXSIZE 128 /* Implementation specific max size */ > struct sockaddr_storage { > sa_family_t ss_family; > char __data[_SS_MAXSIZE - sizeof(sa_family_t)]; > } __attribute __ ((aligned(sizeof(struct sockaddr *)))); > This works for me. I really just needed the struct to come out to 128 bytes. > The use of the 'sizeof(struct sockaddr *)' for specifying the required > alignment is just to illustrate the second criteria for this structure > as documented in the RFC, i.e. "It is aligned at an appropriate boundary > so protocol specific socket address data structure pointers can be cast > to it and access their fields without alignment problems...". > Yes. I agree. > I'll resubmit a patch tomorrow with the above definition if there are no > objections. > OK. I compiled this on 4 and 8 byte alignements. jon |