Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753234AbYCXE4v (ORCPT ); Mon, 24 Mar 2008 00:56:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751735AbYCXE4m (ORCPT ); Mon, 24 Mar 2008 00:56:42 -0400 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:53233 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751619AbYCXE4m (ORCPT ); Mon, 24 Mar 2008 00:56:42 -0400 Date: Sun, 23 Mar 2008 21:56:41 -0700 (PDT) Message-Id: <20080323.215641.192753003.davem@davemloft.net> To: samuel.thibault@ens-lyon.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen From: David Miller In-Reply-To: <20080308022321.GC5853@implementation> References: <20080308022321.GC5853@implementation> X-Mailer: Mew version 5.2 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 971 Lines: 24 From: Samuel Thibault 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 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. -- 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/