On Sun, 7 Mar 2004, Marc Aurele La France wrote:

> Redirected to devel@
>
> On Sun, 7 Mar 2004, Peter Breitenlohner wrote:
>
> > 1. xdm produced an error message
> >     chooser socket creation failed
> > and there was just a useless parent process but no child process(es) and no
> > Xserver was started. ...
>
> > 2. Trying to start chooser by hand lead to a segmentation fault! ...
>
> Please check if your changes actually fix the problem.

Hi Marc Aurele,

attached please find a patch addressing these problems. This patch fixes some
of the most obvious problems but more needs to be done.

In a situation were the linux kernel does not support IPv6 sockets

ad 1. The IPv6 enabled xdm does start a local X server but does not accept
chooser connections.

ad 2. The IPv6 enabled chooser works fine provided xdm is compiled without
IPv6 support.

Since there are many places with '#ifdef IPv6' I haven't found out why the
chooser<=>xdm interaction fails.

**************************************

Just another point: even if (the IPv6 enabled) Xnest is started with
'-nolisten inet6' a message
        XDMCP warning: INET6 UDP socket creation failed
is produced. I suspect the same happens with XFree86. This certainly should
not happen.

regards
Peter Breitenlohner <[EMAIL PROTECTED]>
        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)
     {

Reply via email to