This is the mail archive of the
mailing list for the Cygwin project.
Re: [1.7] IPv6 accept() fails if address_len is < sizeof(sockaddr_in6) [was Re: PATCH /usr/include/X11/Xtrans/Xtranssock.c [WAS: Re: xhost package not compiled for IPv6]]
- From: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- To: cygwin-xfree at cygwin dot com, cygwin at cygwin dot com
- Date: Wed, 12 Aug 2009 16:20:33 +0100
- Subject: Re: [1.7] IPv6 accept() fails if address_len is < sizeof(sockaddr_in6) [was Re: PATCH /usr/include/X11/Xtrans/Xtranssock.c [WAS: Re: xhost package not compiled for IPv6]]
- References: <4A78A511.firstname.lastname@example.org> <4A803D7C.email@example.com> <4A825EE5.firstname.lastname@example.org> <4A82BB83.email@example.com> <4A82C835.firstname.lastname@example.org> <20090812135941.GD13438@calimero.vinschen.de>
On 12/08/2009 14:59, Corinna Vinschen wrote:
On Aug 12 14:48, Jon TURNEY wrote:
On 12/08/2009 13:54, Jon TURNEY wrote:
Hmmm... but if it's really the size of the sockname argument which is
causing the accept() to fail, this would be a bug in cygwin's accept()
implementation, as it's supposed to truncate the data written to the
sockname, rather than fail if it won't fit . If that actually is the
case, since we don't actually use the peer address here, the code as
stands is correct (if a little odd).
I suppose I need to write a small test case to look at this...
A couple of small programs which hopefully demonstrate this problem.
(As is, the connection fails, but uncommenting the alternate definition
of cliaddr in listener.c allows it to work)
I'd hazard a guess that perhaps this is because the underlying winsock
accept() doesn't have this truncate behaviour and considers a too-small
address_len an error.
Thanks for the testcase!
Oh, I meant to say "A couple of small programs shamelessly copied from UNIX
Network Programming". So don't thank me, thank W. Richard Stevens :-)
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple