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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux