From: "David S. Miller" <davem@redhat.com>
To: bwa@us.ibm.com
Cc: lksctp-developers@lists.sourceforge.net,
linux-net@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: [PATCH] subset of RFC2553
Date: Wed, 12 Feb 2003 21:43:05 -0800 (PST) [thread overview]
Message-ID: <20030212.214305.67672796.davem@redhat.com> (raw)
In-Reply-To: <1045091741.8858.320.camel@w-bwa1.beaverton.ibm.com>
From: Bruce Allan <bwa@us.ibm.com>
Date: 12 Feb 2003 15:15:39 -0800
I don't like how sockaddr_storage works, so you'll have to clean
it up before we move it to a generic spot.
+struct sockaddr_storage {
+ sa_family_t ss_family; /* address family */
+ /* Following fields are implementation specific */
+ char __ss_pad1[_SS_PAD1SIZE];
+ /* 6 byte pad, this is to make implementation */
+ /* specific pad up to alignment field that */
+ /* follows explicit in the data structure */
+ int64_t __ss_align; /* field to force desired structure */
+ /* storage alignment */
+ char __ss_pad2[_SS_PAD2SIZE];
+ /* 112 byte pad to achieve desired size, */
+ /* _SS_MAXSIZE value minus size of ss_family */
+ /* __ss_pad1, __ss_align fields is 112 */
+};
All of this pad stuff is really unnecessary, just specify ss_family
and then "stuff" where "stuff" can be something like "char __data[0];"
Then you can add "attribute((aligned(64)))" or whatever to the
declaration as well.
And if you're going to put some 64-bit type in here, use "__u64"
which actually makes you consistent with the rest of the kernel.
You could also do something like:
__u64 data[_SS_MAXSIZE / sizeof(__u64)];
Anything but this pad stuff...
next prev parent reply other threads:[~2003-02-13 5:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-12 23:15 [PATCH] subset of RFC2553 Bruce Allan
2003-02-13 2:24 ` [Lksctp-developers] " Jon Grimm
2003-02-13 5:43 ` David S. Miller [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-02-19 2:32 Bruce Allan
2003-02-19 23:26 ` [Lksctp-developers] " Jon Grimm
2003-02-20 0:21 ` David S. Miller
2003-02-21 17:06 ` Bruce Allan
2003-02-22 7:23 ` David S. Miller
2003-02-22 7:26 ` David S. Miller
2003-02-24 17:54 ` Bruce Allan
2003-03-03 8:44 ` David S. Miller
2003-02-22 9:26 ` Pekka Savola
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030212.214305.67672796.davem@redhat.com \
--to=davem@redhat.com \
--cc=bwa@us.ibm.com \
--cc=linux-net@vger.kernel.org \
--cc=lksctp-developers@lists.sourceforge.net \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).