Thread (13 messages) 13 messages, 4 authors, 2003-03-03

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

From: Jon Grimm <hidden>
Date: 2003-02-20 21:24:01


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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help