* clarify code intent
@ 2008-09-18 17:07 Mathieu Lacage
2008-09-18 23:36 ` David Miller
2008-09-23 0:29 ` Andi Kleen
0 siblings, 2 replies; 5+ messages in thread
From: Mathieu Lacage @ 2008-09-18 17:07 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 536 bytes --]
hi,
The attached patch hopefully clarifies the intent of the unix_bind
function in net/unix/af_unix.c. That 'feature' (the ability to delegate
the endpoint allocation to the kernel with bind by sending a
sockaddr_un.sun_family = AF_UNIX rather than have to wait until the
autobind is triggered by a later call to send) would be nice to document
in the unix '7' manpage but, I have no idea where these are maintained.
I also have no idea whether that specific 'feature' is common among
other unixes. It is quite useful though.
Mathieu
[-- Attachment #2: p --]
[-- Type: text/x-patch, Size: 405 bytes --]
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 015606b..efa725e 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -777,7 +777,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (sunaddr->sun_family != AF_UNIX)
goto out;
- if (addr_len==sizeof(short)) {
+ if (addr_len==sizeof(sa_family_t)) {
err = unix_autobind(sock);
goto out;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: clarify code intent
2008-09-18 17:07 clarify code intent Mathieu Lacage
@ 2008-09-18 23:36 ` David Miller
2008-09-18 23:53 ` Mathieu Lacage
2008-09-23 0:29 ` Andi Kleen
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2008-09-18 23:36 UTC (permalink / raw)
To: mathieu.lacage; +Cc: netdev
From: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Date: Thu, 18 Sep 2008 10:07:48 -0700
> The attached patch hopefully clarifies the intent of the unix_bind
> function in net/unix/af_unix.c.
I've rejected this patch over and over in the past, and nothing
has happened to change my mind since then.
----------------------------------------
Subject: Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen
From: David Miller <davem@davemloft.net>
To: samuel.thibault@ens-lyon.org
Cc: mtk.manpages@gmail.com, mtk.manpages@googlemail.com,
andi@firstfloor.org, linux-kernel@vger.kernel.org
Date: Sat, 26 Apr 2008 22:54:32 -0700 (PDT)
X-Mailer: Mew version 5.2 on Emacs 22.1 / Mule 5.0 (SAKAKI)
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat, 26 Apr 2008 02:44:45 +0100
> AF_UNIX: make unix_getname use sizeof(sunaddr->sun_family) instead of
> sizeof(short).
>
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This is just syntactic masterbation, sa_family_t is typedef'd
"unsigned short".
No system on planet earth providing the BSD sockets API uses
anything other than uint16_t or unsigned short for this.
Sorry, I'm not applying this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: clarify code intent
2008-09-18 23:36 ` David Miller
@ 2008-09-18 23:53 ` Mathieu Lacage
2008-09-18 23:59 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Lacage @ 2008-09-18 23:53 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Thu, 2008-09-18 at 16:36 -0700, David Miller wrote:
> This is just syntactic masterbation, sa_family_t is typedef'd
> "unsigned short".
Would you take a patch to remove sa_family_t from the kernel code and
headers ? Otherwise, I suspect that you can understand that it is a bit
hard for others to figure out where it is appropriate to use it and
where it is not.
regards,
Mathieu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: clarify code intent
2008-09-18 23:53 ` Mathieu Lacage
@ 2008-09-18 23:59 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2008-09-18 23:59 UTC (permalink / raw)
To: mathieu.lacage; +Cc: netdev
From: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Date: Thu, 18 Sep 2008 16:53:40 -0700
> On Thu, 2008-09-18 at 16:36 -0700, David Miller wrote:
>
> > This is just syntactic masterbation, sa_family_t is typedef'd
> > "unsigned short".
>
> Would you take a patch to remove sa_family_t from the kernel code and
> headers ? Otherwise, I suspect that you can understand that it is a bit
> hard for others to figure out where it is appropriate to use it and
> where it is not.
No, that would break older userspace.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: clarify code intent
2008-09-18 17:07 clarify code intent Mathieu Lacage
2008-09-18 23:36 ` David Miller
@ 2008-09-23 0:29 ` Andi Kleen
1 sibling, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2008-09-23 0:29 UTC (permalink / raw)
To: Mathieu Lacage; +Cc: netdev
Mathieu Lacage <mathieu.lacage@sophia.inria.fr> writes:
> The attached patch hopefully clarifies the intent of the unix_bind
> function in net/unix/af_unix.c. That 'feature' (the ability to delegate
> the endpoint allocation to the kernel with bind by sending a
> sockaddr_un.sun_family = AF_UNIX rather than have to wait until the
> autobind is triggered by a later call to send) would be nice to document
> in the unix '7' manpage but, I have no idea where these are maintained.
They are maintained by the manpage maintainer mtk.manpages@googlemail.com
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-23 0:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 17:07 clarify code intent Mathieu Lacage
2008-09-18 23:36 ` David Miller
2008-09-18 23:53 ` Mathieu Lacage
2008-09-18 23:59 ` David Miller
2008-09-23 0:29 ` Andi Kleen
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).