From: ebiederm@xmission.com (Eric W. Biederman)
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>,
tglx@linutronix.de, mingo@redhat.com, davem@davemloft.net,
thierry.reding@avionic-design.de, bfields@redhat.com,
eric.dumazet@gmail.com, xemul@parallels.com, neilb@suse.de,
netdev@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org, paul.gortmaker@windriver.com,
viro@zeniv.linux.org.uk, gorcunov@openvz.org,
akpm@linux-foundation.org, tim.c.chen@linux.intel.com,
devel@openvz.org
Subject: Re: [RFC PATCH 0/5] net: socket bind to file descriptor introduced
Date: Wed, 15 Aug 2012 14:25:42 -0700 [thread overview]
Message-ID: <87k3wzalux.fsf@xmission.com> (raw)
In-Reply-To: <502C0D7C.2040707@zytor.com> (H. Peter Anvin's message of "Wed, 15 Aug 2012 13:58:36 -0700")
"H. Peter Anvin" <hpa@zytor.com> writes:
> On 08/15/2012 12:49 PM, Eric W. Biederman wrote:
>>
>> There is also the trick of getting a shorter directory name using
>> /proc/self/fd if you are threaded and can't change the directory.
>>
>> The obvious choices at this point are
>> - Teach bind and connect and af_unix sockets to take longer AF_UNIX
>> socket path names.
>>
>> - introduce sockaddr_fd that can be applied to AF_UNIX sockets,
>> and teach unix_bind and unix_connect how to deal with a second type of sockaddr.
>> struct sockaddr_fd { short fd_family; short pad; int fd; };
>>
>> - introduce sockaddr_unix_at that takes a directory file descriptor
>> as well as a unix path, and teach unix_bind and unix_connect to deal with a
>> second sockaddr type.
>> struct sockaddr_unix_at { short family; short pad; int dfd; char path[102]; }
>> AF_UNIX_AT
>>
>> I don't know what the implications of for breaking connect up into 3
>> system calls and changing the semantics are and I would really rather
>> not have to think about it.
>>
>> But it certainly does not look to me like you introduce new systems
>> calls to do what you want.
>>
>
> How would you distinguish the new sockaddr types from the traditional
> one? New AF_?
Yeah. AF_FD or AF_UNIX_AT is what I was thinking. The way the code
falls out that should be compartively simple to implement.
recvmsg etc would give you sockaddr_un sockets when they come from the
kernel.
Eric
next prev parent reply other threads:[~2012-08-15 21:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-15 16:21 [RFC PATCH 0/5] net: socket bind to file descriptor introduced Stanislav Kinsbursky
2012-08-15 16:22 ` [RFC PATCH 1/5] net: cleanup unix_bind() a little Stanislav Kinsbursky
2012-08-15 16:22 ` [RFC PATCH 2/5] net: split unix_bind() Stanislav Kinsbursky
2012-08-15 16:22 ` [RFC PATCH 3/5] net: new protocol operation fbind() introduced Stanislav Kinsbursky
2012-08-15 16:22 ` [RFC PATCH 4/5] net: fbind() for unix sockets protocol operations introduced Stanislav Kinsbursky
2012-08-15 16:22 ` [RFC PATCH 5/5] syscall: sys_fbind() introduced Stanislav Kinsbursky
2012-08-15 16:30 ` H. Peter Anvin
2012-08-15 16:43 ` Stanislav Kinsbursky
2012-08-15 16:52 ` [RFC PATCH 0/5] net: socket bind to file descriptor introduced Ben Pfaff
2012-08-15 17:54 ` H. Peter Anvin
2012-08-15 19:49 ` Eric W. Biederman
2012-08-15 20:58 ` H. Peter Anvin
2012-08-15 21:25 ` Eric W. Biederman [this message]
2012-08-16 3:03 ` Eric W. Biederman
2012-08-16 13:54 ` J. Bruce Fields
2012-08-20 10:18 ` Stanislav Kinsbursky
2012-09-04 19:00 ` J. Bruce Fields
2012-10-05 20:00 ` J. Bruce Fields
2012-10-08 8:37 ` Stanislav Kinsbursky
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=87k3wzalux.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=bfields@redhat.com \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=eric.dumazet@gmail.com \
--cc=gorcunov@openvz.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=neilb@suse.de \
--cc=netdev@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=skinsbursky@parallels.com \
--cc=tglx@linutronix.de \
--cc=thierry.reding@avionic-design.de \
--cc=tim.c.chen@linux.intel.com \
--cc=viro@zeniv.linux.org.uk \
--cc=x86@kernel.org \
--cc=xemul@parallels.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).