lkml.org 
[lkml]   [2008]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen
Michael Kerrisk, le Thu 24 Apr 2008 10:31:15 +0200, a écrit :
> > > and I see that in net/unix/af_unix.c::unix_getname() there is:
> > >
> >
> > > *uaddr_len = sizeof(short);
> >
> > I'd say that code should be fixed into using sa_family_t.
>
> Is there a patch for this?

Here it is



AF_UNIX: make unix_getname use sizeof(sunaddr->sun_family) instead of
sizeof(short).

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

--- linux/net/unix/af_unix.c.orig 2008-04-26 02:41:45.000000000 +0100
+++ linux/net/unix/af_unix.c 2008-04-26 02:42:07.000000000 +0100
@@ -1256,7 +1256,7 @@ static int unix_getname(struct socket *s
if (!u->addr) {
sunaddr->sun_family = AF_UNIX;
sunaddr->sun_path[0] = 0;
- *uaddr_len = sizeof(short);
+ *uaddr_len = sizeof(sunaddr->sun_family);
} else {
struct unix_address *addr = u->addr;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2008-04-26 03:59    [W:0.108 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site