[Xorg-commit] xc/programs/Xserver/os access.c,1.1.4.2,1.1.4.2.2.1

Harold L Hunt II xorg-commit at pdx.freedesktop.org
Wed May 9 17:30:30 EEST 2007


Committed by: harold

Update of /cvs/xorg/xc/programs/Xserver/os
In directory pdx:/tmp/cvs-serv2671

Modified Files:
      Tag: CYGWIN
	access.c 
Log Message:
Filter all 0.0.0.0 addresses from being sent to the other end of the wire when using Xdmcp.  Suggested on devel at xfree86.org and discussed by many people in that and other forums.

Index: access.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/os/access.c,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.2.2.1
diff -u -d -r1.1.4.2 -r1.1.4.2.2.1
--- access.c	26 Nov 2003 22:49:06 -0000	1.1.4.2
+++ access.c	29 Jan 2004 00:56:24 -0000	1.1.4.2.2.1
@@ -438,14 +438,24 @@
 		continue;
 
 	    /*
- 	     * ignore 'localhost' entries as they're not useful
-	     * on the other end of the wire
+ 	     * Ignore 'localhost' entries as they're not useful
+	     * on the other end of the wire.
 	     */
 	    if (len == 4 &&
 		addr[0] == 127 && addr[1] == 0 &&
 		addr[2] == 0 && addr[3] == 1)
 		continue;
 
+	    /*
+	     * Ignore '0.0.0.0' entries as they are
+	     * returned by some OSes for unconfigured NICs but they are
+	     * not useful on the other end of the wire.
+	     */
+	    if (len == 4 &&
+		addr[0] == 0 && addr[1] == 0 &&
+		addr[2] == 0 && addr[3] == 0)
+		continue;
+
 	    XdmcpRegisterConnection (family, (char *)addr, len);
 
 
@@ -570,11 +580,15 @@
 #ifdef XDMCP
 		/*
 		 *  If this is an Internet Address, but not the localhost
-		 *  address (127.0.0.1), register it.
+		 *  address (127.0.0.1), nor the bogus address (0.0.0.0),
+		 *  register it.
 		 */
 		if (family == FamilyInternet &&
-		    !(len == 4 && addr[0] == 127 && addr[1] == 0 &&
-		      addr[2] == 0 && addr[3] == 1)
+		    !(len == 4 &&
+		      ((addr[0] == 127 && addr[1] == 0 &&
+			addr[2] == 0 && addr[3] == 1) ||
+		       (addr[0] == 0 && addr[1] == 0 &&
+			addr[2] == 0 && addr[3] == 0))
 		   )
 		{
 		    XdmcpRegisterConnection (family, (char *)addr, len);
@@ -821,6 +835,16 @@
 		continue;
 #endif
 
+	    /*
+	     * Ignore '0.0.0.0' entries as they are
+	     * returned by some OSes for unconfigured NICs but they are
+	     * not useful on the other end of the wire.
+	     */
+	    if (len == 4 &&
+		addr[0] == 0 && addr[1] == 0 &&
+		addr[2] == 0 && addr[3] == 0)
+		continue;
+
 	    XdmcpRegisterConnection (family, (char *)addr, len);
 
 #if defined(IPv6) && defined(AF_INET6)
@@ -925,14 +949,26 @@
 	     */
 	    if (family != FamilyInternet) 
 		continue;
+
 	    /* 
-	     * ignore 'localhost' entries as they're not usefule
-	     * on the other end of the wire
+	     * Ignore 'localhost' entries as they're not usefule
+	     * on the other end of the wire.
 	     */
 	    if (len == 4 && 
 		addr[0] == 127 && addr[1] == 0 &&
-		addr[2] == 0 && addr[2] == 1) 
+		addr[2] == 0 && addr[3] == 1) 
 		continue;
+
+	    /*
+	     * Ignore '0.0.0.0' entries as they are
+	     * returned by some OSes for unconfigured NICs but they are
+	     * not useful on the other end of the wire.
+	     */
+	    if (len == 4 &&
+		addr[0] == 0 && addr[1] == 0 &&
+		addr[2] == 0 && addr[3] == 0)
+		continue;
+
 	    XdmcpRegisterConnection(family, (char *)addr, len);
 	    if ((ifr->ifa_flags & IFF_BROADCAST) &&
 		(ifr->ifa_flags & IFF_UP))





More information about the xorg-commit mailing list