[Xorg] [Bug 287] New: xdm won't run on non-IPv6 system if built with IPv6 support

bugzilla-daemon at pdx.freedesktop.org bugzilla-daemon at pdx.freedesktop.org
Mon Mar 8 08:30:09 PST 2004


http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=287

           Summary: xdm won't run on non-IPv6 system if built with IPv6
                    support
           Product: xorg
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: server
        AssignedTo: xorg at freedesktop.org
        ReportedBy: alan.coopersmith at sun.com


Reported by Peter Breitenlohner <peb at mppmu.mpg.de> in a thread on devel at XFree86.org:

> I fully understand that XFree86 has to support IPv6. The current
> implementation has, however, a serious flaw: when compiled with IPv6 support
> (which is the default for most linux/gnu systems) the progams implicitly
> assume that IPv6 is supported by the kernel. In our case that is not so, and
> in order to get things working I had to
> 	#define BuildIPv6		NO
> in xc/config/cf/host.def, thereby permanantly disabling IPv6 support.

> It would be extremely helpful if one could compile XFree86 with IPv6
> support, but then disable IPv6 at runtime via configuration files
> (resources) and/or command line options (in order to avoid various
> timeouts), and the programs should automatically fall back to IPv4 in case
> IPv6 is not supported by the kernel.

> The actual problems encountered were twofold:

> 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. I think the lines 69ff in xc/programs/xdm/socket.c
> 	#if defined(IPv6) && defined(AF_INET6)
> 	    chooserFd = socket (AF_INET6, SOCK_STREAM, 0);
> 	#else
> 	    chooserFd = socket (AF_INET, SOCK_STREAM, 0);
> 	#endif
> ought to be
> 	#if defined(IPv6) && defined(AF_INET6)
> 	    chooserFd = socket (AF_INET6, SOCK_STREAM, 0);
> 	    if (chooserFd == -1)
> 	#endif
> 	    chooserFd = socket (AF_INET, SOCK_STREAM, 0);
> although I haven't tested this.

> 2. Trying to start chooser by hand lead to a segmentation fault! With a
> little tracing I found the following code in xc/programs/xdm/chooser.c in
> lines 844ff
> 	#if defined(IPv6) && defined(AF_INET6)
> 	    socket6FD = socket (AF_INET6, SOCK_DGRAM, 0);
> 	#endif
> and later in lines 856ff
> 	    XtAddInput (socketFD, (XtPointer) XtInputReadMask, ReceivePacket,
> 			(XtPointer) &socketFD);
> 	#if defined(IPv6) && defined(AF_INET6)
> 	    XtAddInput (socket6FD, (XtPointer) XtInputReadMask, ReceivePacket,
> 			(XtPointer) &socket6FD);
> 	#endif
> The second code fragment certainly ought to be
> 	    XtAddInput (socketFD, (XtPointer) XtInputReadMask, ReceivePacket,
> 			(XtPointer) &socketFD);
> 	#if defined(IPv6) && defined(AF_INET6)
> 	    if (socket6FD != -1)
> 	    XtAddInput (socket6FD, (XtPointer) XtInputReadMask, ReceivePacket,
> 			(XtPointer) &socket6FD);
> 	#endif
> but that may not suffice. Calling XtAddInput with a untested first argument
> is just asking for serious trouble.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the xorg mailing list