From: Chuck Lever <chuck.lever@oracle.com>
To: Lennart Poettering <lennart@poettering.net>
Cc: Tom Gundersen <teg@jklm.no>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
Michal Schmidt <mschmidt@redhat.com>,
Steve Dickson <steved@redhat.com>,
systemd-devel@lists.freedesktop.org,
libtirpc <libtirpc-devel@lists.sourceforge.net>
Subject: Re: [PATCH] rpcbind: add support for systemd socket activation
Date: Wed, 1 Feb 2012 17:03:38 -0500 [thread overview]
Message-ID: <5748CC59-354A-4D97-AF0C-224975BCA253@oracle.com> (raw)
In-Reply-To: <20120201214536.GL18571@tango.0pointer.de>
On Feb 1, 2012, at 4:45 PM, Lennart Poettering wrote:
> On Wed, 01.02.12 17:37, Tom Gundersen (teg@jklm.no) wrote:
>
>>>> + /* Try to find if one of the systemd sockets we were given match
>>>> + * our netconfig structure. */
>>>> +
>>>> + for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) {
>>>> + struct __rpc_sockinfo si_other;
>>>> + union {
>>>> + struct sockaddr sa;
>>>> + struct sockaddr_un un;
>>>> + struct sockaddr_in in4;
>>>> + struct sockaddr_in6 in6;
>>>> + struct sockaddr_storage storage;
>>>> + } sa;
>>>
>>> Why is sockaddr_storage included in this union?
>>
>> This is from Lennart's original patch. Lennart, care to comment?
>
> Well, simply because sockaddr_storage is the actual struct one should
> normally use for this kind of thing (where you try to determine a
> sockaddr from a socket you don't know at all). With one exception
> however, sockaddr_un is actually longer than sockaddr_storage, which is
> documented borkedness in the socket API.
You don't reference any of the fields inside this union, except for sa. It seems unnecessary to include all of these members, and then not use most of them.
The biggest address you're ever going to get out of libtirpc is a sockaddr_storage. If we must stick with a union to prevent pointer aliasing, can we have just two members: sockaddr and sockaddr_storage?
Otherwise, there's no need for this kind of generality here: TI-RPC handles only IPv4, IPv6, and AF_LOCAL.
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
next prev parent reply other threads:[~2012-02-01 22:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-07 15:18 [PATCH v2] rpcbind: add support for systemd socket activation Tom Gundersen
2011-12-15 14:54 ` [systemd-devel] " Lennart Poettering
2011-12-19 23:42 ` Cristian Rodriguez
2011-12-23 1:05 ` [PATCH] " Tom Gundersen
2011-12-23 1:34 ` Cristian Rodríguez
2011-12-23 2:40 ` Jim Rees
2012-02-01 11:47 ` Tom Gundersen
2012-02-01 15:32 ` Chuck Lever
2012-02-01 16:37 ` Tom Gundersen
2012-02-01 18:16 ` Chuck Lever
2012-02-01 19:48 ` Tom Gundersen
2012-02-01 21:45 ` Lennart Poettering
2012-02-01 22:03 ` Chuck Lever [this message]
2012-02-01 22:30 ` Lennart Poettering
2012-02-03 10:58 ` [Libtirpc-devel] " Ian Kent
2012-02-03 17:03 ` Chuck Lever
2012-02-04 8:59 ` [PATCH v2] " Tom Gundersen
2012-02-01 19:59 ` [PATCH] " Chuck Lever
-- strict thread matches above, loose matches on Subject: below --
2014-11-25 17:05 [PATCH] rpcbind: systemd socket activation (v2) Steve Dickson
2014-11-25 17:05 ` [PATCH] rpcbind: add support for systemd socket activation Steve Dickson
2014-11-26 12:48 ` Steve Dickson
2014-11-21 16:43 [PATCH] rpcbind: " Steve Dickson
2014-11-21 16:43 ` [PATCH] rpcbind: add support for " Steve Dickson
2010-07-19 2:19 Lennart Poettering
2010-07-21 17:56 ` Chuck Lever
2010-07-21 21:56 ` Lennart Poettering
2010-07-23 15:13 ` Chuck Lever
2010-07-23 16:27 ` Lennart Poettering
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=5748CC59-354A-4D97-AF0C-224975BCA253@oracle.com \
--to=chuck.lever@oracle.com \
--cc=lennart@poettering.net \
--cc=libtirpc-devel@lists.sourceforge.net \
--cc=linux-nfs@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=steved@redhat.com \
--cc=systemd-devel@lists.freedesktop.org \
--cc=teg@jklm.no \
/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).