linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lennart Poettering <lennart@poettering.net>
To: Chuck Lever <chuck.lever@oracle.com>
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 23:30:27 +0100	[thread overview]
Message-ID: <20120201223027.GA29681@tango.0pointer.de> (raw)
In-Reply-To: <5748CC59-354A-4D97-AF0C-224975BCA253@oracle.com>

On Wed, 01.02.12 17:03, Chuck Lever (chuck.lever@oracle.com) wrote:

> >>> 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.

Well, as said, sockaddr_un is actually larger than sockaddr_storage, and
hence you definitely do need sockaddr_un in the union. The IP cases are
covered by sockaddr_storage however, and hence can be left out of the
union.

I mean, it's completely up to you what is used here, I just figured the
point of the whole library was to be an exercise in keeping things
independent from the used socket family.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.

  reply	other threads:[~2012-02-01 22:30 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
2012-02-01 22:30               ` Lennart Poettering [this message]
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=20120201223027.GA29681@tango.0pointer.de \
    --to=lennart@poettering.net \
    --cc=chuck.lever@oracle.com \
    --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).