xserver/os access.c,3.48,3.49

Harold L Hunt II xserver-commit at pdx.freedesktop.org
Wed Mar 17 17:53:13 PST 2004


Committed by: harold

Update of /cvs/xserver/xserver/os
In directory pdx:/tmp/cvs-serv21724/os

Modified Files:
	access.c 
Log Message:
Prune 0.0.0.0 address returned by the OS.

Index: access.c
===================================================================
RCS file: /cvs/xserver/xserver/os/access.c,v
retrieving revision 3.48
retrieving revision 3.49
diff -u -d -r3.48 -r3.49
--- a/access.c	29 Sep 2003 01:42:40 -0000	3.48
+++ b/access.c	18 Mar 2004 01:53:11 -0000	3.49
@@ -419,14 +419,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);
 
 
@@ -534,12 +544,16 @@
 #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);
 		    broad_addr = *inetaddr;
@@ -705,6 +719,16 @@
 		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);
 	    broad_addr = ifr->ifr_addr;
 	    ((struct sockaddr_in *) &broad_addr)->sin_addr.s_addr =
@@ -780,13 +804,24 @@
 	    if (family != FamilyInternet) 
 		continue;
 	    /* 
-	     * ignore 'localhost' entries as they're not usefule
+	     * 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[2] == 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 xserver-commit mailing list