netdev
[Top] [All Lists]

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

To: Bruce Allan <bwa@xxxxxxxxxx>
Subject: Re: [Lksctp-developers] Re: [PATCH] subset of RFC2553
From: Jon Grimm <jgrimm2@xxxxxxxxxx>
Date: Thu, 20 Feb 2003 15:24:01 -0600
Cc: lksctp-developers@xxxxxxxxxxxxxxxxxxxxx, linux-net@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
Organization: IBM
References: <1045621941.1253.21.camel@xxxxxxxxxxxxxxxxxxxxxxxx> <3E54128C.327D7759@xxxxxxxxxx> <3E541FEA.C34BEEB7@xxxxxxxxxx> <3E542F52.50001@xxxxxxxxxx> <3E554063.3010008@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.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


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