From: "Gary V. Vaughan" <git@mlists.thewrittenword.com>
To: Brandon Casey <casey@nrlssc.navy.mil>
Cc: Jeff King <peff@peff.net>,
git@vger.kernel.org, kusmabite@gmail.com, martin@martin.st,
Brandon Casey <drafnel@gmail.com>
Subject: Re: [PATCH] daemon.c: avoid accessing ss_family member of struct sockaddr_storage
Date: Sun, 25 Apr 2010 03:37:03 -0500 (CDT) [thread overview]
Message-ID: <20100316065127.GA26370@thor.il.thewrittenword.com> (raw)
In-Reply-To: <s0MQZSOEsdBJUhITxC3jwfFJk5PnIEo0WR5z_GEnSOw@cipher.nrlssc.navy.mil>
The git@mlists... address is the one subscribed to this list, to make
it easy for us to filter list messages into shared folders. Because
we manage so many packages, one or other of us will drop in and out of
contact on the relevant lists depending what package we happen to be
working on.
Anyway, you can always put a post directly in my INBOX by Cc:ing
gary@thewrittenword.com and/or gary@gnu.org if you'd like to be sure
that I will read something. :)
On Mon, Mar 15, 2010 at 04:42:57PM -0500, Brandon Casey wrote:
> I expect that the layout of the sockaddr_* family of structures will
> follow the layout of struct sockaddr, otherwise they wouldn't be
> compatible.
>
> In other words, I think that if struct sockaddr looks like this:
>
> struct sockaddr {
> uchar_t sa_len; /* total length */
> sa_family_t sa_family; /* address family */
> char sa_data[14]; /* actually longer; address value */
> };
>
> then somewhere else, struct sockaddr_in looks like this:
>
> struct sockaddr_in {
> uchar_t sin_len;
> sin_family_t sin_family;
> sin_port;
> sin_addr;
> ...
> };
> On 03/15/2010 04:29 PM, Jeff King wrote:
> > Or am I wrong in assuming that, and on AIX sockaddr_in actually has
> > sa_len at the front, so casting to sockaddr does the right thing (and my
> > recommendation above would actually be broken)? The AIX boxen I have
> > access to are all down at the moment.
>
> Maybe Gary can check for us... Gary, what does the declaration for
> struct sockaddr_in look like in your AIX header file?
/usr/include/netinet/in.h excerpt:
/*
* Socket address, internet style.
*/
struct sockaddr_in {
uchar_t sin_len;
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
uchar_t sin_zero[8];
};
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
next prev parent reply other threads:[~2010-04-25 8:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-11 16:37 [PATCH 5/5] struct sockaddr_storage->ss_family is not portable Gary V. Vaughan
2010-03-11 16:40 ` Martin Storsjö
2010-03-12 4:56 ` Gary V. Vaughan
2010-03-12 7:24 ` Martin Storsjö
2010-03-15 21:03 ` [PATCH] daemon.c: avoid accessing ss_family member of struct sockaddr_storage Brandon Casey
2010-03-15 21:29 ` Jeff King
2010-03-15 21:41 ` Martin Storsjö
2010-03-15 21:42 ` Brandon Casey
2010-04-25 8:37 ` Gary V. Vaughan [this message]
2010-03-15 21:37 ` Martin Storsjö
2010-03-15 22:10 ` [PATCH v2] " Brandon Casey
2010-03-16 7:52 ` Martin Storsjö
2010-04-25 8:36 ` [PATCH 5/5] struct sockaddr_storage->ss_family is not portable Gary V. Vaughan
2010-04-25 19:05 ` Martin Storsjö
2010-04-26 16:55 ` Gary V. Vaughan
2010-03-11 22:27 ` Jeff King
2010-03-11 23:57 ` Brandon Casey
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=20100316065127.GA26370@thor.il.thewrittenword.com \
--to=git@mlists.thewrittenword.com \
--cc=casey@nrlssc.navy.mil \
--cc=drafnel@gmail.com \
--cc=git@vger.kernel.org \
--cc=kusmabite@gmail.com \
--cc=martin@martin.st \
--cc=peff@peff.net \
/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