Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 8 Aug 2002 14:33:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 8 Aug 2002 14:33:08 -0400 Received: from sex.inr.ac.ru ([193.233.7.165]:38274 "HELO sex.inr.ac.ru") by vger.kernel.org with SMTP id ; Thu, 8 Aug 2002 14:33:08 -0400 From: kuznet@ms2.inr.ac.ru Message-Id: <200208081836.WAA03110@sex.inr.ac.ru> Subject: Re: Unix-domain sockets - abstract addresses To: lkml@procter-collective.ORG.UK (Michael Procter) Date: Thu, 8 Aug 2002 22:36:38 +0400 (MSD) Cc: linux-kernel@vger.kernel.org In-Reply-To: <20020808171524.A2469@cad.citel.com> from "Michael Procter" at Aug 8, 2 08:45:01 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1235 Lines: 39 Hello! > According to the man page 'unix(7)': > When a socket is connected and it doesn't already have a local address a > unique address in the abstract namespace will be generated automatically. This is wrong. The address is not autogenerated unless SO_PASSCRED is requested by security&compatibility reasons. So, if the socket is SOCK_DGRAM it is anounymous and "send-only", it is impossible to reply to it. > but I have seen 0x0BA5, 0x7FA8, 0x1FA8 and others). Yes, this is bug. The fix is enclosed. It should return nil address. > So, the question is: which is right? The man page, or af_unix.c? Both of them are wrong. Alexey --- af_unix.c.orig Thu Aug 8 22:23:56 2002 +++ af_unix.c Thu Aug 8 22:34:58 2002 @@ -1432,7 +1432,7 @@ static void unix_copy_addr(struct msghdr *msg, struct sock *sk) { - msg->msg_namelen = sizeof(short); + msg->msg_namelen = 0; if (sk->protinfo.af_unix.addr) { msg->msg_namelen=sk->protinfo.af_unix.addr->len; memcpy(msg->msg_name, - 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/