This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH /usr/include/X11/Xtrans/Xtranssock.c [WAS: Re: xhost package not compiled for IPv6]


On Aug 12 13:54, Jon TURNEY wrote:
> diff --git a/Xtranssock.c b/Xtranssock.c
> index 0935744..4d2e2cb 100644
> --- a/Xtranssock.c
> +++ b/Xtranssock.c
> @@ -1260,7 +1260,11 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
>
>  {
>      XtransConnInfo     newciptr;
> +#if defined(IPv6) && defined(AF_INET6)
> +    struct sockaddr_storage    sockname;
> +#else
>      struct sockaddr_in sockname;
> +#endif
>      SOCKLEN_T          namelen = sizeof(sockname);
>
>      PRMSG (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
>
>
> 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 [1].  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).

If so, it's a problem in WinSock in the first place.  From MSDN it looks
like accept doesn't truncate the data, but rather returns WSAEFAULT if
the size argument is too small for the given socket domain.

> I suppose I need to write a small test case to look at this...

That would be nice.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]