lkml.org 
[lkml]   [2008]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen
From
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat, 8 Mar 2008 02:23:21 +0000

> Accept and getpeername are supposed to return the amount of bytes
> written in the returned address. However, on unnamed sockets, only
> sizeof(short) is returned, while a 0 is put in the sun_path member.
> This patch adds 1 for that additional byte.
>
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

This change isn't correct. It's the fact that the
length returned is sizeof(short) that tells the caller
that the unix socket is unnamed.

We zero out the sun_path[0] member just to be polite
and tidy.

You would break applications if you changed this, so
marking this patch as "trivial" is extremely premature.


\
 
 \ /
  Last update: 2008-03-24 05:59    [W:0.051 / U:2.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site