PATCH /usr/include/X11/Xtrans/Xtranssock.c [WAS: Re: xhost package not compiled for IPv6]
cygwin
karl@sipxx.com
Wed Aug 12 06:19:00 GMT 2009
The following patch corrects the problem reported as:
"The server listens on IPv6 addresses ok and recognizes incoming
connections, but then the client just hangs. The server logs
"_XSERVTransSocketINETAccept: accept() failed"
--- /usr/include/X11/Xtrans/Xtranssock.c.orig 2009-08-12
02:02:43.640625000 -0400
+++ /usr/include/X11/Xtrans/Xtranssock.c 2009-08-12
02:04:10.078125000 -0400
@@ -1255,7 +1255,7 @@
{
XtransConnInfo newciptr;
- struct sockaddr_in sockname;
+ struct sockaddr_storage sockname;
SOCKLEN_T namelen = sizeof(sockname);
PRMSG (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
With this in place, and recompiling the X11 server it will properly
accept client connections over IPv6 transport.
The IPv6 socket implementation for the X11 server seems rather poorly
written, it does not follow the generally recommended practice of
porting IPv4 code for IPv6/IPv4 dual stack.
Enjoy, Karl Brose
Jon TURNEY wrote:
> On 04/08/2009 22:16, cygwin wrote:
>> Currently, setup-1.7 installs a version of xhost (1.0.2-1) that is not
>> compiled properly for IPv6 protocol support.
>> When querying against an IPv6 X server IPv6 addresses are not
>> recognized.
>> The fix for this is to simply rebuild the xhost package.
>
> Thanks for the bug report.
>
>> However, to get it to work at all with the Cygwin/X server, you have to
>> be using IPv4 transport, as IPv6 support seems broken. The server
>> listens on IPv6 addresses ok and recognizes incoming connections, but
>> then it just hangs. Has anyone diagnosed this further? I believe the
>> problem is in accept() system call.
>
> "The server listens on IPv6 addresses ok and recognizes incoming
> connections, but then the client just hangs. The server logs
> "_XSERVTransSocketINETAccept: accept() failed"
>
> Yes, I was able to reproduce this by installing IPV6 and setting
> DISPLAY=localhost:0.0, as a IPv6 connection seems to be used first.
> From a quick debugging session it looks like the IPv6 socket
> connection is really made (shown by netstat --p tcpv6 -a -b -n), but
> that accept() in the server returns -1, which is very odd.
>
> You can workaround this problem by setting DISPLAY=:0.0 (which will
> use a unix domain socket transport) or by starting the X server with
> the '-nolisten inet6' argument added.
>
--
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/
More information about the Cygwin-xfree
mailing list