Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Oct 1996 22:14:39 PDT
From:      Bill Fenner <fenner@parc.xerox.com>
To:        Jean-Marc Zucconi <jmz@cabri.obs-besancon.fr>
Cc:        freebsd-current@freebsd.org
Subject:   Re: socket (AF_UNIX) bug 
Message-ID:  <96Oct20.221445pdt.177480@crevenia.parc.xerox.com>
In-Reply-To: Your message of "Sun, 20 Oct 96 19:18:14 PDT." <9610210218.AA09736@cabri.obs-besancon.fr> 

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?96Oct20.221445pdt.177480>