From owner-freebsd-current Sun Oct 20 22:15:31 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id WAA23253 for current-outgoing; Sun, 20 Oct 1996 22:15:31 -0700 (PDT) Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id WAA23245 for ; Sun, 20 Oct 1996 22:15:29 -0700 (PDT) Received: from crevenia.parc.xerox.com ([13.2.116.11]) by alpha.xerox.com with SMTP id <16058(5)>; Sun, 20 Oct 1996 22:14:58 PDT Received: from localhost by crevenia.parc.xerox.com with SMTP id <177480>; Sun, 20 Oct 1996 22:14:45 -0700 To: Jean-Marc Zucconi cc: freebsd-current@freebsd.org Subject: Re: socket (AF_UNIX) bug In-reply-to: Your message of "Sun, 20 Oct 96 19:18:14 PDT." <9610210218.AA09736@cabri.obs-besancon.fr> Date: Sun, 20 Oct 1996 22:14:39 PDT From: Bill Fenner Message-Id: <96Oct20.221445pdt.177480@crevenia.parc.xerox.com> Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <9610210218.AA09736@cabri.obs-besancon.fr> you write: >The following code creates a socket whose name is 1 char too >short. A workaround is to add 1 to addrlen before calling bind, but I >think that the code should work as is. You forgot to include the length of sun_len (which happens to be 1) in addrlen. Since you're telling the kernel that addr is 1 byte shorter than it is, it's not surprising that it isn't getting all that you're trying to send it. I would just set addrlen to sizeof(struct sockaddr_un). To be fully correct, you should probably also set sun_len as well. Bill