Re: Fix for Xlib with ipv6 support on ipv4 only systems

2003-08-14 Thread Egbert Eich
Mark Vojkovich writes:
  On Fri, 8 Aug 2003, Egbert Eich wrote:
  
   Mark Vojkovich writes:
   Out of curiosity.  Is the ipv6 supposed to be working properly now?
 Last time I updated, I noticed that remote operation was broken.
 That is, Xlib was unable to connect to a remote system (I assume
 it didn't work with internet sockets anymore, but unix domain sockets
 still worked).
 
   Hm, what did you do? I never had any issues connecting to a remote
   system. Neither thru ipv4 nor ipv6. The only thing I noticed was 
   that there are still issues with authetication for ipv6. 
   For mu tests I used the -ac option to get around this.
   
   Did you get any error messages?
   
  
  The server is on dhcp-178-150:0 and is slightly newer than XFree86 4.3,
  but is not from any recent CVS.  It is pre-ipv6 support.  It has access 
  control disabled (xhost +).
  
  The client is on dhcp-178-251 and is using fairly recent libraries
  from CVS.  The DISPLAY is set to dhcp-178-150:0.0 and I get:
  
  _X11TransSocketOpen: socket() failed for tcp
  _X11TransSocketOpenCOTSClient: Unable to open socket for tcp
  _X11TransOpen: transport open failed for tcp/dhcp-178-150:0
  xterm Xt error: Can't open display: dhcp-178-150:0.0
  
  
 I find that:
  
  1) The 4.3 libraries can connect to a CVS server.
  2) CVS libraries can connect to a CVS server.
  3) CVS libraries cannot connect to a 4.3 server.
  

It looks like the same problem Andrew had. Your Xlib is built
with IPv6 support, but your kerneld doesn't support it.
One of the patches I've posted is supposed to take care of
it. 
I still have a huge backlog of email to read. If noone has
objected so far I will commit my fixes later.

Egbert.
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Fix for Xlib with ipv6 support on ipv4 only systems

2003-08-14 Thread Egbert Eich

The path below will fix the problem that arises when running 
a client on an inet4 only system over tcp with Xlib compiled 
with inet6 support. 

If noone objects I'll commit it.

Egbert.

Index: Xtranssock.c
===
RCS file: /home/eich/cvs/xc/lib/xtrans/Xtranssock.c,v
retrieving revision 1.1.1.10
diff -u -r1.1.1.10 Xtranssock.c
--- Xtranssock.c6 Aug 2003 16:17:24 -   1.1.1.10
+++ Xtranssock.c7 Aug 2003 13:12:47 -
@@ -192,6 +192,7 @@
 {tcp,AF_INET,SOCK_STREAM,SOCK_DGRAM,0},
 #else /* IPv6 */
 {tcp,AF_INET6,SOCK_STREAM,SOCK_DGRAM,0},
+{tcp,AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, /* fallback */
 {inet6,AF_INET6,SOCK_STREAM,SOCK_DGRAM,0},
 #endif
 #endif /* TCPCONN */
@@ -275,20 +276,20 @@
  */
 
 static int
-TRANS(SocketSelectFamily) (char *family)
+TRANS(SocketSelectFamily) (int first, char *family)
 
 {
 int i;
 
 PRMSG (3,SocketSelectFamily(%s)\n, family, 0, 0);
 
-for (i = 0; i  NUMSOCKETFAMILIES;i++)
+for (i = first + 1; i  NUMSOCKETFAMILIES;i++)
 {
 if (!strcmp (family, Sockettrans2devtab[i].transname))
return i;
 }
 
-return -1;
+return (first == -1 ? -2 : -1);
 }
 
 
@@ -418,7 +419,7 @@
 #endif
 #endif
   ) {
-   PRMSG (1, SocketOpen: socket() failed for %s\n,
+   PRMSG (2, SocketOpen: socket() failed for %s\n,
Sockettrans2devtab[i].transname, 0, 0);
 
xfree ((char *) ciptr);
@@ -483,26 +484,25 @@
 
 {
 XtransConnInfo ciptr;
-inti;
+inti = -1;
 
 PRMSG (2, SocketOpenCOTSClient(%s,%s,%s)\n,
protocol, host, port);
 
 SocketInitOnce();
 
-if ((i = TRANS(SocketSelectFamily) (thistrans-TransName))  0)
-{
-   PRMSG (1,
-   SocketOpenCOTSClient: Unable to determine socket type for %s\n,
-   thistrans-TransName, 0, 0);
-   return NULL;
-}
-
-if ((ciptr = TRANS(SocketOpen) (
-   i, Sockettrans2devtab[i].devcotsname)) == NULL)
-{
-   PRMSG (1,SocketOpenCOTSClient: Unable to open socket for %s\n,
-   thistrans-TransName, 0, 0);
+while ((i = TRANS(SocketSelectFamily) (i, thistrans-TransName)) = 0) {
+   if ((ciptr = TRANS(SocketOpen) (
+i, Sockettrans2devtab[i].devcotsname)) != NULL)
+   break;
+}
+if (i  0) {
+   if (i == -1)
+   PRMSG (1,SocketOpenCOTSClient: Unable to open socket for %s\n,
+  thistrans-TransName, 0, 0);
+   else
+   PRMSG (1,SocketOpenCOTSClient: Unable to determine socket type for %s\n,
+  thistrans-TransName, 0, 0);
return NULL;
 }
 
@@ -524,25 +524,24 @@
 
 {
 XtransConnInfo ciptr;
-inti;
+inti = -1;
 
 PRMSG (2,SocketOpenCOTSServer(%s,%s,%s)\n, protocol, host, port);
 
 SocketInitOnce();
 
-if ((i = TRANS(SocketSelectFamily) (thistrans-TransName))  0)
-{
-   PRMSG (1,
-   SocketOpenCOTSServer: Unable to determine socket type for %s\n,
-   thistrans-TransName, 0, 0);
-   return NULL;
-}
-
-if ((ciptr = TRANS(SocketOpen) (
-   i, Sockettrans2devtab[i].devcotsname)) == NULL)
-{
-   PRMSG (1,SocketOpenCOTSServer: Unable to open socket for %s\n,
-   thistrans-TransName, 0, 0);
+while ((i = TRANS(SocketSelectFamily) (i, thistrans-TransName)) = 0) {
+   if ((ciptr = TRANS(SocketOpen) (
+i, Sockettrans2devtab[i].devcotsname)) != NULL)
+   break;
+}
+if (i  0) {
+   if (i == -1)
+   PRMSG (1,SocketOpenCOTSServer: Unable to open socket for %s\n,
+  thistrans-TransName, 0, 0);
+   else
+   PRMSG (1,SocketOpenCOTSServer: Unable to determine socket type for %s\n,
+  thistrans-TransName, 0, 0);
return NULL;
 }
 
@@ -592,25 +591,24 @@
 
 {
 XtransConnInfo ciptr;
-inti;
+inti = -1;
 
 PRMSG (2,SocketOpenCLTSClient(%s,%s,%s)\n, protocol, host, port);
 
 SocketInitOnce();
 
-if ((i = TRANS(SocketSelectFamily) (thistrans-TransName))  0)
-{
-   PRMSG (1,
-   SocketOpenCLTSClient: Unable to determine socket type for %s\n,
-   thistrans-TransName, 0, 0);
-   return NULL;
-}
-
-if ((ciptr = TRANS(SocketOpen) (
-   i, Sockettrans2devtab[i].devcotsname)) == NULL)
-{
-   PRMSG (1,SocketOpenCLTSClient: Unable to open socket for %s\n,
- thistrans-TransName, 0, 0);
+while ((i = TRANS(SocketSelectFamily) (i, thistrans-TransName)) = 0) {
+   if ((ciptr = TRANS(SocketOpen) (
+i, Sockettrans2devtab[i].devcotsname)) != NULL)
+   break;
+}
+if (i  0) {
+   if (i == -1)
+   PRMSG (1,SocketOpenCLTSClient: Unable to open socket for %s\n,
+  thistrans-TransName, 0, 0);
+   else
+   PRMSG 

Re: Fix for Xlib with ipv6 support on ipv4 only systems

2003-08-14 Thread Mark Vojkovich
On Fri, 8 Aug 2003, Egbert Eich wrote:

 Mark Vojkovich writes:
 Out of curiosity.  Is the ipv6 supposed to be working properly now?
   Last time I updated, I noticed that remote operation was broken.
   That is, Xlib was unable to connect to a remote system (I assume
   it didn't work with internet sockets anymore, but unix domain sockets
   still worked).
   
 Hm, what did you do? I never had any issues connecting to a remote
 system. Neither thru ipv4 nor ipv6. The only thing I noticed was 
 that there are still issues with authetication for ipv6. 
 For mu tests I used the -ac option to get around this.
 
 Did you get any error messages?
 

The server is on dhcp-178-150:0 and is slightly newer than XFree86 4.3,
but is not from any recent CVS.  It is pre-ipv6 support.  It has access 
control disabled (xhost +).

The client is on dhcp-178-251 and is using fairly recent libraries
from CVS.  The DISPLAY is set to dhcp-178-150:0.0 and I get:

_X11TransSocketOpen: socket() failed for tcp
_X11TransSocketOpenCOTSClient: Unable to open socket for tcp
_X11TransOpen: transport open failed for tcp/dhcp-178-150:0
xterm Xt error: Can't open display: dhcp-178-150:0.0


   I find that:

1) The 4.3 libraries can connect to a CVS server.
2) CVS libraries can connect to a CVS server.
3) CVS libraries cannot connect to a 4.3 server.

Mark.

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Fix for Xlib with ipv6 support on ipv4 only systems

2003-08-14 Thread Mark Vojkovich
  Out of curiosity.  Is the ipv6 supposed to be working properly now?
Last time I updated, I noticed that remote operation was broken.
That is, Xlib was unable to connect to a remote system (I assume
it didn't work with internet sockets anymore, but unix domain sockets
still worked).

Mark.

On Thu, 7 Aug 2003, Egbert Eich wrote:

 
 The path below will fix the problem that arises when running 
 a client on an inet4 only system over tcp with Xlib compiled 
 with inet6 support. 
 
 If noone objects I'll commit it.
 
 Egbert.
 
 

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel