logo       

Re: [Lksctp-developers] Re: [PATCH] subset of RFC2553: msg#00121

Subject: Re: [Lksctp-developers] Re: [PATCH] subset of RFC2553


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





<Prev in Thread] Current Thread [Next in Thread>