Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Tue, 20 Apr 2004, Peter Breitenlohner wrote: yes, that was it. I have revoked my changes to xc/programs/xdm/xdmcp.c lines ca. 1420ff (patch-16-IPv6, kludge) and instead fixed the (s/!=/==/) and this works for us, except on the notebooks without network connection. When I have some time during the easter hollidays I'll try to figure out that last problem. OK. Thanks for getting back to me on that. Hi Marc, meanwhile I did some strace-ing and wrote a small test program and therby finally have found out why our notebooks (when off the network) took such a long time (ca. 10min) to start xdm. This was caused by the IPv6-enabled xdm only insofar as in that case `getaddrinfo' is used to resolve hostnames as opposed to `gethostbyname' in the IPv6-disabled version. As far as I can see the problem could equally have occured if IPv6 were supported by the linux kernel. There was an accumulation of several circumstances, some of them particular to our setup. I give a somewhat detailed description what happened, because other people might encounter similar problems (delays). 1. we have a CHOOSER hostlist with 51 unqualified hostnames (we can't use CHOOSER BROADCAST for various reasons). 2. `getaddrinfo(host, NULL, NULL, ai)' (as used by xdm) produced a 10sec timeout, whereas `getaddrinfo(host.domain, NULL, NULL, ai)' as well as `gethostbyname(host)' give an immediate answer. 2.1. the glibc-2.[23].x implementation of `getaddrinfo(host, NULL, NULL, ai)' first queries the nameserver for host.domain and then for host (whereas `gethostbyname(host)' only queries for host.domain). I don't have the slightest idea what's the reason for this pecularity (feature or bug) of getaddrinfo since from the nameserver's point of view a domainname host without any dots doesn't make much sense. 2.2. the nameserver (ISC bind-9.2.3) on the notebook has forward and reverse slave zone files for our domain, but for sure couldn't resolve an unqualified hostname. Unfortunately it was configured to forward the request to resolve host to other namesevers (recursion), thereby producing a bad timeout. Disabling this recursion of the slave nameserver has solved all the problems we had. You seem to be implying that host.domain isn't resolvable, which doesn't make much sense. Marc. +--+---+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax:1-780-492-1729 | | 352 General Services Building | email: [EMAIL PROTECTED] | | University of Alberta +---+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply| | CANADA | | +--+---+ XFree86 developer and VP. ATI driver and X server internals. ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Tue, 6 Apr 2004, Marc Aurele La France wrote: On Mon, 5 Apr 2004, Peter Breitenlohner wrote: yes, that was it. I have revoked my changes to xc/programs/xdm/xdmcp.c lines ca. 1420ff (patch-16-IPv6, kludge) and instead fixed the (s/!=/==/) and this works for us, except on the notebooks without network connection. When I have some time during the easter hollidays I'll try to figure out that last problem. OK. Thanks for getting back to me on that. Hi Marc, meanwhile I did some strace-ing and wrote a small test program and therby finally have found out why our notebooks (when off the network) took such a long time (ca. 10min) to start xdm. This was caused by the IPv6-enabled xdm only insofar as in that case `getaddrinfo' is used to resolve hostnames as opposed to `gethostbyname' in the IPv6-disabled version. As far as I can see the problem could equally have occured if IPv6 were supported by the linux kernel. There was an accumulation of several circumstances, some of them particular to our setup. I give a somewhat detailed description what happened, because other people might encounter similar problems (delays). 1. we have a CHOOSER hostlist with 51 unqualified hostnames (we can't use CHOOSER BROADCAST for various reasons). 2. `getaddrinfo(host, NULL, NULL, ai)' (as used by xdm) produced a 10sec timeout, whereas `getaddrinfo(host.domain, NULL, NULL, ai)' as well as `gethostbyname(host)' give an immediate answer. 2.1. the glibc-2.[23].x implementation of `getaddrinfo(host, NULL, NULL, ai)' first queries the nameserver for host.domain and then for host (whereas `gethostbyname(host)' only queries for host.domain). I don't have the slightest idea what's the reason for this pecularity (feature or bug) of getaddrinfo since from the nameserver's point of view a domainname host without any dots doesn't make much sense. 2.2. the nameserver (ISC bind-9.2.3) on the notebook has forward and reverse slave zone files for our domain, but for sure couldn't resolve an unqualified hostname. Unfortunately it was configured to forward the request to resolve host to other namesevers (recursion), thereby producing a bad timeout. Disabling this recursion of the slave nameserver has solved all the problems we had. regards Peter Breitenlohner [EMAIL PROTECTED] ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Mon, 5 Apr 2004, Peter Breitenlohner wrote: Note: The change in xdmcp.c(NetworkAddressToHostname) is quite a kludge, but somehow I got tired to further nail down what goes wrong. There is a comment in the code to that effect and explaining exactly what went wrong. One reason the affected code doesn't work could be that the memcmp part of the condition ending the loop appears inverted, a fix for which (s/!=/==/) I've now committed. Please verify. yes, that was it. I have revoked my changes to xc/programs/xdm/xdmcp.c lines ca. 1420ff (patch-16-IPv6, kludge) and instead fixed the (s/!=/==/) and this works for us, except on the notebooks without network connection. When I have some time during the easter hollidays I'll try to figure out that last problem. OK. Thanks for getting back to me on that. Marc. +--+---+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax:1-780-492-1729 | | 352 General Services Building | email: [EMAIL PROTECTED] | | University of Alberta +---+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply| | CANADA | | +--+---+ XFree86 developer and VP. ATI driver and X server internals. ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Sat, 3 Apr 2004, Marc Aurele La France wrote: On Mon, 22 Mar 2004, Peter Breitenlohner wrote: Note: The change in xdmcp.c(NetworkAddressToHostname) is quite a kludge, but somehow I got tired to further nail down what goes wrong. There is a comment in the code to that effect and explaining exactly what went wrong. One reason the affected code doesn't work could be that the memcmp part of the condition ending the loop appears inverted, a fix for which (s/!=/==/) I've now committed. Please verify. Hi Marc, yes, that was it. I have revoked my changes to xc/programs/xdm/xdmcp.c lines ca. 1420ff (patch-16-IPv6, kludge) and instead fixed the (s/!=/==/) and this works for us, except on the notebooks without network connection. When I have some time during the easter hollidays I'll try to figure out that last problem. Peter ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Fri, 2 Apr 2004, Peter Breitenlohner wrote: 1. thanks for applying these patches (as well as those from patch seq: 6190). When do you expect patches in ftp:/XFree86/4.4.0/fixes/ ? I've no plans to provide any. Few would bother disabling their kernel's IPv6 support. I didn't mean IPv6 in particular, but all the patches/fixes accumulated so far. As far as I can see, nothing's been critical so far. Anything else can be had through CVS. Have you tried my suggestion regarding this kludge, as you call it? Which suggestion? I didn't see any, but maybe your mail was lost between all the spam I got (in spite of filtering). Could you please resend the suggestion. This one: On Tue, 30 Mar 2004, Marc Aurele La France wrote: On Mon, 22 Mar 2004, Peter Breitenlohner wrote: Note: The change in xdmcp.c(NetworkAddressToHostname) is quite a kludge, but somehow I got tired to further nail down what goes wrong. There is a comment in the code to that effect and explaining exactly what went wrong. One reason the affected code doesn't work could be that the memcmp part of the condition ending the loop appears inverted, a fix for which (s/!=/==/) I've now committed. Please verify. Marc. +--+---+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax:1-780-492-1729 | | 352 General Services Building | email: [EMAIL PROTECTED] | | University of Alberta +---+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply| | CANADA | | +--+---+ XFree86 developer and VP. ATI driver and X server internals. ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Thu, 1 Apr 2004, Marc Aurele La France wrote: On Thu, 1 Apr 2004, Peter Breitenlohner wrote: 1. thanks for applying these patches (as well as those from patch seq: 6190). When do you expect patches in ftp:/XFree86/4.4.0/fixes/ ? I've no plans to provide any. Few would bother disabling their kernel's IPv6 support. I didn't mean IPv6 in particular, but all the patches/fixes accumulated so far. Have you tried my suggestion regarding this kludge, as you call it? Which suggestion? I didn't see any, but maybe your mail was lost between all the spam I got (in spite of filtering). Could you please resend the suggestion. Peter ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
Marc Aurele La France wrote: On Mon, 22 Mar 2004, Peter Breitenlohner wrote: It seems that originally there were plans to have two distinct sockets that were abandonned in the middle. Maybe that ought to be cleaned up (fairly trivial mods in xdmcp.c, just excise chooserFd6). Since Alan Coopersmith originally implemented this on Solaris, which can handle both IPv6 and IPv4 on the same socket, there was initially only one socket. As you might know, IPv4 addresses mapped in IPv6 are considered by a potential security problem and are disabled by default in some of the *BSD systems. (I can't repost the link to Itojun's papers on this later). For now IPv6 support for xdmcp is disabled on the hosts that don't support mapped v4 addresses. I started to implement something with 2 sockets for xdmcp, but it turned out to be too much modifications for the XFree86 code freeze (which lasted longer than I expected). It is possible that some of the ChooserFd6 code present here splipped through some of my other fixes for xdm. I think it would be better to keep the chooserFd's separate, i.e. change socket.c. My reasoning is that some systems don't allow IPv4 traffic with an IPv6 socket, i.e. IPv6 is treated as a seperate protocol, rather than a superset of IPv4. Yes I think that too. But the changes to the control flow of xdm are pretty invasive to support that. It's on my todo list for the next weeks when (hopefully) I'll have some more time to spend on X hacking. Another issue is that the XDM-AUTHORIZATION-1 protocol cannot support. A new revision XDM-AUTHORIZATION-2 has been designed by X.Org but no one has implemented it yet. Althrough XDM-AUTHORIZATION-1 is not built by default by XFree86, it provides some enhancements to the security of remote X connections. -- Matthieu ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Tue, 30 Mar 2004, Marc Aurele La France wrote: I've committed these. Thanks. Hi Marc, 1. thanks for applying these patches (as well as those from patch seq: 6190). When do you expect patches in ftp:/XFree86/4.4.0/fixes/ ? 2. Meanwhile I carefully reread the xdm manpage and found out that my last patch (patch-17-segfault) didn't do the right thing. According to the manpage an Access file statement LISTEN (without interface) should disable listening. The attached patch corrects this. 3. Let me summarize our current status: On all our (mpi theory group) permanent linux system we run the IPv6 enabled XFree86, xdm, and chooser. All host have a chooser list (with IPv4 hostnames) and LISTEN 0.0.0.0. There are a few choosers running for ncd terminals and for Xnest. All Xservers are started with -nolisten inet6 and all this works to our satisfaction. There are, however, a few notebooks, all with a slave nameserver and a slave nis server. As long as they are attached to the local network everything is fine. Without network connection there is a terrible delay (of the order of 10 minutes or more) until xdm and X start. I have tried without LISTEN as well as with LISTEN, LISTEN *, and LISTEN 0.0.0.0 but this makes no difference. The Xserver eventually starts but it takes a very long time. For those notebooks we therefore use an IPv6 disabled version of xdm and with that version everything is OK. From experience with other programs (we had, e.g., to disable IPv6 support in ssh) I suspect the long delays are due to some (direct or reverse) dns lookups, although I never understood why that is so. We certainly don't use any explicit inet6 addresses. The necessity for the change in xdm/xdmcp.c around line 1420 (kludge, patch-16-IPv6) might actually stem from a similar lookup failure. These problems only occur in xdm, the IPv6 enabled versions of chooser, XFree86, and Xnest work without problems (there are just a few harmless warnings). In view of all this and since Debian, Mandrake, RedHat, SuSE et. al. will certainly distribute IPv6 enabled versions it would probably be extremely useful to have a command line option and/or resource and/or Xaccess file statement to completely disable xdm's use of IPv6 at runtime. This would mean to keep some of the non-IPv6 code in the IPv6 enabled version of xdm, and in particular using gethostname instead of getaddrinfo since this seems to cause all the problems. Without such an option I forsee an endless sequence of questions on the mailing list(s) that are related (in a non-obvious way) to this issue. regards Peter Breitenlohner [EMAIL PROTECTED]This patch (to be applied on top of the previous patch-17-segfault) fixes the Access file statement LISTEN (without interface). According to the xdm manpage this should completely disable listening as long as there are no other LISTEN's. diff -ur -N XF86-4.4.0.orig/xc/programs/xdm/access.c XF86-4.4.0/xc/programs/xdm/access.c --- XF86-4.4.0.orig/xc/programs/xdm/access.c2004-03-23 11:13:43.0 +0100 +++ XF86-4.4.0/xc/programs/xdm/access.c 2004-04-01 11:24:12.0 +0200 @@ -901,9 +901,7 @@ if (d-type == DISPLAY_LISTEN) { listenFound = 1; h = d-hosts; - if (h == NULL) { - (*listenfunction) (NULL, closure); - } else { + if (h != NULL) { (*listenfunction) (h-entry.hostAddress, closure); for (h = h-next; h != NULL; h = h-next) { (*mcastfunction) (h-entry.hostAddress, closure);
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Thu, 1 Apr 2004, Peter Breitenlohner wrote: On Tue, 30 Mar 2004, Marc Aurele La France wrote: I've committed these. Thanks. Hi Marc, 1. thanks for applying these patches (as well as those from patch seq: 6190). When do you expect patches in ftp:/XFree86/4.4.0/fixes/ ? I've no plans to provide any. Few would bother disabling their kernel's IPv6 support. 2. Meanwhile I carefully reread the xdm manpage and found out that my last patch (patch-17-segfault) didn't do the right thing. According to the manpage an Access file statement LISTEN (without interface) should disable listening. The attached patch corrects this. Done. 3. Let me summarize our current status: On all our (mpi theory group) permanent linux system we run the IPv6 enabled XFree86, xdm, and chooser. All host have a chooser list (with IPv4 hostnames) and LISTEN 0.0.0.0. There are a few choosers running for ncd terminals and for Xnest. All Xservers are started with -nolisten inet6 and all this works to our satisfaction. There are, however, a few notebooks, all with a slave nameserver and a slave nis server. As long as they are attached to the local network everything is fine. Without network connection there is a terrible delay (of the order of 10 minutes or more) until xdm and X start. I have tried without LISTEN as well as with LISTEN, LISTEN *, and LISTEN 0.0.0.0 but this makes no difference. The Xserver eventually starts but it takes a very long time. For those notebooks we therefore use an IPv6 disabled version of xdm and with that version everything is OK. From experience with other programs (we had, e.g., to disable IPv6 support in ssh) I suspect the long delays are due to some (direct or reverse) dns lookups, although I never understood why that is so. We certainly don't use any explicit inet6 addresses. The necessity for the change in xdm/xdmcp.c around line 1420 (kludge, patch-16-IPv6) might actually stem from a similar lookup failure. These problems only occur in xdm, the IPv6 enabled versions of chooser, XFree86, and Xnest work without problems (there are just a few harmless warnings). Have you tried my suggestion regarding this kludge, as you call it? Marc. +--+---+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax:1-780-492-1729 | | 352 General Services Building | email: [EMAIL PROTECTED] | | University of Alberta +---+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply| | CANADA | | +--+---+ XFree86 developer and VP. ATI driver and X server internals. ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Mon, 22 Mar 2004, Peter Breitenlohner wrote: Note: The change in xdmcp.c(NetworkAddressToHostname) is quite a kludge, but somehow I got tired to further nail down what goes wrong. There is a comment in the code to that effect and explaining exactly what went wrong. One reason the affected code doesn't work could be that the memcmp part of the condition ending the loop appears inverted, a fix for which (s/!=/==/) I've now committed. Please verify. 2. In browsing through xc/programs/xdm/*.c in noticed something strange: xc/programs/xdm/xdmcp.c declares and uses both chooserFd and chooserFd6. xc/programs/xdm/socket.c however creates just chooserFd as either an INET6 or INET socket, thus chooserFd6 keeps it's initial value -1 and none of the chooserFd6 related code in xdmcp.c will ever be executed. It seems that originally there were plans to have two distinct sockets that were abandonned in the middle. Maybe that ought to be cleaned up (fairly trivial mods in xdmcp.c, just excise chooserFd6). I think it would be better to keep the chooserFd's separate, i.e. change socket.c. My reasoning is that some systems don't allow IPv4 traffic with an IPv6 socket, i.e. IPv6 is treated as a seperate protocol, rather than a superset of IPv4. Marc. +--+---+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax:1-780-492-1729 | | 352 General Services Building | email: [EMAIL PROTECTED] | | University of Alberta +---+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply| | CANADA | | +--+---+ XFree86 developer and VP. ATI driver and X server internals. ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Tue, 23 Mar 2004, Peter Breitenlohner wrote: On Mon, 22 Mar 2004, Peter Breitenlohner wrote: . With the two patches the IPv6 enabled chooser, xdm, and XFree86 server work together quite well on a linux system without IPv6 support from the kernel. . the above was somewhat too enthusiastic since there was (at least) one remaining problem (not directly related to IPv6): xdm segfaulted with an Xaccess directive LISTEN without a hostname. Attached are two additional patches, one for this and another one for a trivial manpage typo. I hope you will be able to commit all that. I've committed these. Thanks. Marc. +--+---+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax:1-780-492-1729 | | 352 General Services Building | email: [EMAIL PROTECTED] | | University of Alberta +---+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply| | CANADA | | +--+---+ XFree86 developer and VP. ATI driver and X server internals. ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Mon, 15 Mar 2004, Marc Aurele La France wrote: OK. I've committed this. Perhaps someone else will step up to fix the remaining problems. Hi Marc Aurele, 1. meanwhile I have done some testing and debugging (with some extra Debug(...) statements in order to narrow down the problem). The result is an additional patch (both are attached). With the two patches the IPv6 enabled chooser, xdm, and XFree86 server work together quite well on a linux system without IPv6 support from the kernel. Each of the two patches begins with some comments. There are still some warnings but with those we can live. Most of them will probably disappear with '-nolisten inet6' and with a LISTEN statement in the xdm config file. Note: The change in xdmcp.c(NetworkAddressToHostname) is quite a kludge, but somehow I got tired to further nail down what goes wrong. There is a comment in the code to that effect and explaining exactly what went wrong. Unless some brave soul fixes that, the modified code should probably be reformatted (different indentation do to an additional brace level). Honestly I was just too lazy to do that. 2. In browsing through xc/programs/xdm/*.c in noticed something strange: xc/programs/xdm/xdmcp.c declares and uses both chooserFd and chooserFd6. xc/programs/xdm/socket.c however creates just chooserFd as either an INET6 or INET socket, thus chooserFd6 keeps it's initial value -1 and none of the chooserFd6 related code in xdmcp.c will ever be executed. It seems that originally there were plans to have two distinct sockets that were abandonned in the middle. Maybe that ought to be cleaned up (fairly trivial mods in xdmcp.c, just excise chooserFd6). 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.0 +0100 +++ XF86-4.4.0/xc/programs/xdm/chooser.c2004-03-08 08:59:09.0 +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.c2003-11-25 23:21:08.0 +0100 +++ XF86-4.4.0/xc/programs/xdm/socket.c 2004-03-08 09:32:36.0 +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) { This patch fixes the remaining problems arising if XFree86 is compiled with IPv6 support, but the (linux) kernel does not support IPv6. This patch is to be applied on top of patch-15-IPv6. Note: The original code for UpdateListener in xc/programs/xdm/socket.c could not possibly work for addr == NULL || addr-length == 0 because in resp. in6 were used outside the domain of validity of these structures. Similarly all_query_respond in xc/programs/xdm/xdmcp.c couldn't possibly work due to some FamilyInternet(6) vs. AF_INET(6) confusion. diff -ur -N XF86-4.4.0.orig/xc/programs/xdm/auth.c XF86-4.4.0/xc/programs/xdm/auth.c --- XF86-4.4.0.orig/xc/programs/xdm/auth.c 2004-01-16 01:03:54.0 +0100 +++ XF86-4.4.0/xc/programs/xdm/auth.c 2004-03-21 16:24:04.0 +0100 @@ -1182,9 +1182,9 @@ #ifdef TCPCONN #if defined(IPv6) defined(AF_INET6) fd = socket (AF_INET6, SOCK_STREAM, 0); -#else -fd = socket (AF_INET, SOCK_STREAM, 0); +if (fd == -1) #endif +fd = socket (AF_INET, SOCK_STREAM, 0); DefineSelf (fd, file, auth); close (fd); #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.c2004-03-08 09:32:36.0 +0100 +++ XF86-4.4.0/xc/programs/xdm/socket.c 2004-03-22 16:28:48.0 +0100 @@ -298,22 +298,24 @@ UpdateListener(ARRAY8Ptr addr, void
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Mon, 8 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. 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. OK. I've committed this. Perhaps someone else will step up to fix the remaining progblems. Thanks. Marc. +--+---+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax:1-780-492-1729 | | 352 General Services Building | email: [EMAIL PROTECTED] | | University of Alberta +---+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply| | CANADA | | +--+---+ XFree86 developer and VP. ATI driver and X server internals. ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
On Mon, 8 Mar 2004, Andrew C Aitchison wrote: On Sun, 7 Mar 2004, Marc Aurele La France wrote: Redirected to devel@ On Sun, 7 Mar 2004, Peter Breitenlohner wrote: 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. There isn't a config file option (if no-one else adds one I might) but there is the command line switch -nolisten inet6. This switch gets rid of the messages _XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6 _XSERVTransOpen: transport open failed for inet6/ard:0 _XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6 which I otherwise get on my RedHat 6.2 machine, so I think it is disabling inet6 on this machine. Does this solve your problem ? No it does not. This option only applies to the Xservers: XFree86 and Xnest, not to xdm which causes my problems. And even with that option Xnest produces a warning message: XDMCP warning: INET6 UDP socket creation failed regards Peter Breitenlohner [EMAIL PROTECTED] ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
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.0 +0100 +++ XF86-4.4.0/xc/programs/xdm/chooser.c2004-03-08 08:59:09.0 +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.c2003-11-25 23:21:08.0 +0100 +++ XF86-4.4.0/xc/programs/xdm/socket.c 2004-03-08 09:32:36.0 +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) {
Re: (patch seq: 6202) XFree86-4.4.0 -- IPv6 support causes serious problems
Redirected to devel@ On Sun, 7 Mar 2004, Peter Breitenlohner wrote: Dear XFree86 maintainers, 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. Please check if your changes actually fix the problem. Thanks. Marc. +--+---+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax:1-780-492-1729 | | 352 General Services Building | email: [EMAIL PROTECTED] | | University of Alberta +---+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply| | CANADA | | +--+---+ XFree86 developer and VP. ATI driver and X server internals. ___ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel