This patch fixes some (but not all) problems arising if XFree86 is compiled with IPv6 support, but the (linux) kernel does not support IPv6. 1. chooser segfaults: fixed. 2. xdm fails with "chooser socket creation failed" and consequently no Xserver is started: fixed. 3. xdm fails to accept chooser connections: NOT fixed. With these changes we can use the IPv6 enabled xdm for local logins, but not in connection with a chooser. The chooser compiled with IPv6 support works fine together with xdm compiled without IPv6 support. diff -ur -N XF86-4.4.0.orig/xc/programs/xdm/chooser.c XF86-4.4.0/xc/programs/xdm/chooser.c --- XF86-4.4.0.orig/xc/programs/xdm/chooser.c 2003-11-23 23:57:31.000000000 +0100 +++ XF86-4.4.0/xc/programs/xdm/chooser.c 2004-03-08 08:59:09.000000000 +0100 @@ -856,6 +856,7 @@ XtAddInput (socketFD, (XtPointer) XtInputReadMask, ReceivePacket, (XtPointer) &socketFD); #if defined(IPv6) && defined(AF_INET6) + if (socket6FD != -1) XtAddInput (socket6FD, (XtPointer) XtInputReadMask, ReceivePacket, (XtPointer) &socket6FD); #endif diff -ur -N XF86-4.4.0.orig/xc/programs/xdm/socket.c XF86-4.4.0/xc/programs/xdm/socket.c --- XF86-4.4.0.orig/xc/programs/xdm/socket.c 2003-11-25 23:21:08.000000000 +0100 +++ XF86-4.4.0/xc/programs/xdm/socket.c 2004-03-08 09:32:36.000000000 +0100 @@ -68,9 +68,9 @@ #if defined(IPv6) && defined(AF_INET6) chooserFd = socket (AF_INET6, SOCK_STREAM, 0); -#else - chooserFd = socket (AF_INET, SOCK_STREAM, 0); + if (chooserFd == -1) #endif + chooserFd = socket (AF_INET, SOCK_STREAM, 0); Debug ("Created chooser socket %d\n", chooserFd); if (chooserFd == -1) {