[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xfree86-devel
Subject:    Re: XDMCP problems (was: [XonX-Announce] XFree86 4.4.0 RC2)
From:       Mario Klebsch <mario () klebsch ! de>
Date:       2003-12-31 14:33:35
Message-ID: 50B35846-3B9E-11D8-AB8C-000A9586F10A () klebsch ! de
[Download RAW message or body]

Hi!

Am Mittwoch, 31.12.03 um 02:42 Uhr schrieb Mario Klebsch:

>> 1. I'm using '#define HasGetIfAddrs YES' in darwin.cf (This should
>>    probably be the default, but I forgot about it until now), it
>>    changes the way network interfaces addresses are collected.
>
> I did that change manually and broadcasts now work fine. but...
> I also realize, that the GetIfAddrs does not include the IPv6 
> addresses anymore. So it would solve my initial problem, too, but 
> would leave a compatibility problem in the XDMCP code. I suspect, this 
> not really is a fix and an additional bug in the GetIfAddrs code has 
> lead to the IPv6 addresses being left out.

I removed the HasGetIfAddrs definition from darwin.cf again and tried a 
different aproach to solve the XDMCP problem. I reordered the 
connections in a way that connections of the same type as the XDMCP 
manager connection are send first. And it worked. :-)

So, here is my patch to xc/progrqams/Xserver/os/xdmcp.c:


["xdmcp.c.patch" (xdmcp.c.patch)]

Index: xdmcp.c
===================================================================
RCS file: /cvs/xc/programs/Xserver/os/xdmcp.c,v
retrieving revision 3.30
diff -c -r3.30 xdmcp.c
*** xdmcp.c	30 Dec 2003 16:35:19 -0000	3.30
--- xdmcp.c	31 Dec 2003 14:20:13 -0000
***************
*** 1213,1221 ****
--- 1213,1231 ----
      XdmcpHeader	    header;
      int		    length;
      int		    i;
+     CARD16	    XdmcpConnectionType;
      ARRAY8	    authenticationData;
      int		    socketfd = xdmcpSocket;
  
+     switch (SOCKADDR_FAMILY(ManagerAddress))
+     {
+     case AF_INET:	XdmcpConnectionType=FamilyInternet; break;
+ #if defined(IPv6) && defined(AF_INET6)
+     case AF_INET6:	XdmcpConnectionType=FamilyInternet6; break;
+ #endif
+     default:		XdmcpConnectionType=0xffff; break;
+     }
+ 
      header.version = XDM_PROTOCOL_VERSION;
      header.opcode = (CARD16) REQUEST;
  
***************
*** 1246,1253 ****
  	return;
      }
      XdmcpWriteCARD16 (&buffer, DisplayNumber);
!     XdmcpWriteARRAY16 (&buffer, &ConnectionTypes);
!     XdmcpWriteARRAYofARRAY8 (&buffer, &ConnectionAddresses);
  
      XdmcpWriteARRAY8 (&buffer, AuthenticationName);
      XdmcpWriteARRAY8 (&buffer, &authenticationData);
--- 1256,1282 ----
  	return;
      }
      XdmcpWriteCARD16 (&buffer, DisplayNumber);
!     XdmcpWriteCARD8 (&buffer, ConnectionTypes.length);
! 
!     /* The connection array is send reordered, so that connections of	*/
!     /* the same address type as the XDMCP manager connection are send	*/
!     /* first. This works around a bug in xdm. mario@klebsch.de 		*/
!     for (i = 0; i < (int)ConnectionTypes.length; i++)
! 	if (ConnectionTypes.data[i]==XdmcpConnectionType)
! 	    XdmcpWriteCARD16 (&buffer, ConnectionTypes.data[i]);
!     for (i = 0; i < (int)ConnectionTypes.length; i++)
! 	if (ConnectionTypes.data[i]!=XdmcpConnectionType)
! 	    XdmcpWriteCARD16 (&buffer, ConnectionTypes.data[i]);
! 
!     XdmcpWriteCARD8 (&buffer, ConnectionAddresses.length);
!     for (i = 0; i < (int)ConnectionAddresses.length; i++)
! 	if ( (i<ConnectionTypes.length) && 
! 	     (ConnectionTypes.data[i]==XdmcpConnectionType) )
! 	    XdmcpWriteARRAY8 (&buffer, &ConnectionAddresses.data[i]);
!     for (i = 0; i < (int)ConnectionAddresses.length; i++)
! 	if ( (i>=ConnectionTypes.length) ||
! 	     (ConnectionTypes.data[i]!=XdmcpConnectionType) )
! 	    XdmcpWriteARRAY8 (&buffer, &ConnectionAddresses.data[i]);
  
      XdmcpWriteARRAY8 (&buffer, AuthenticationName);
      XdmcpWriteARRAY8 (&buffer, &authenticationData);


I hope this solves the compatibility problem without introducing new 
problems and I wish everyone on these two mailing lists a happy new 
year.

73, Mario

P.S. two problems still are left unresolved:
-broadcast does not send XDMCP requests to a broadcast address and 
DefineSelf() does not deliver IPv6 addresses when HasGetIfAddrs is set.
-- 
Mario Klebsch                                      mario@klebsch.de
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
  Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

_______________________________________________
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic