diff options
author | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-06-25 08:58:18 +0000 |
---|---|---|
committer | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-06-25 08:58:18 +0000 |
commit | 8bc0bc6d36dbc5000069017a1984905065164016 (patch) | |
tree | 9ed42cdcb68d3fee74f7c665f15262dba4647b09 /os | |
parent | c5ab3fdd928d12b4dc28108f2242b3b75e1ac65f (diff) |
#Bug 784: Ignore unconfigured interfaces with xdmcp
Diffstat (limited to 'os')
-rw-r--r-- | os/access.c | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/os/access.c b/os/access.c index 2877373c7..9ac66c179 100644 --- a/os/access.c +++ b/os/access.c @@ -1,5 +1,5 @@ /* $Xorg: access.c,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/os/access.c,v 1.1.4.3.2.3 2004/03/22 11:57:11 ago Exp $ */ +/* $XdotOrg$ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -456,14 +456,24 @@ DefineSelf (int fd) 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); @@ -588,12 +598,16 @@ DefineSelf (int fd) #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; @@ -857,6 +871,16 @@ DefineSelf (int fd) 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) @@ -979,6 +1003,7 @@ DefineSelf (int fd) #endif ) continue; + /* * ignore 'localhost' entries as they're not useful * on the other end of the wire @@ -990,6 +1015,16 @@ DefineSelf (int fd) 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; #if defined(IPv6) && defined(AF_INET6) else if (family == FamilyInternet6 && IN6_IS_ADDR_LOOPBACK((struct in6_addr *)addr)) |