From: Zooko O'Whielacronx Date: Sat, 13 Oct 2007 07:38:16 +0000 (-0700) Subject: filter out "0.0.0.0" from detected IP addresses X-Git-Tag: allmydata-tahoe-0.6.1~23 X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer/status?a=commitdiff_plain;h=af0edec7530333395da5f10c0768f308210e48c6;p=tahoe-lafs%2Ftahoe-lafs.git filter out "0.0.0.0" from detected IP addresses --- diff --git a/src/allmydata/test/test_iputil.py b/src/allmydata/test/test_iputil.py index 3a06b4cd..0f16f72c 100644 --- a/src/allmydata/test/test_iputil.py +++ b/src/allmydata/test/test_iputil.py @@ -16,6 +16,7 @@ class ListAddresses(testutil.SignalMixin, unittest.TestCase): def _check(addresses): self.failUnless(len(addresses) >= 1) # always have localhost self.failUnless("127.0.0.1" in addresses, addresses) + self.failIf("0.0.0.0" in addresses, addresses) d.addCallbacks(_check) return d test_list_async.timeout=2 diff --git a/src/allmydata/util/iputil.py b/src/allmydata/util/iputil.py index db6d240b..d7f4de45 100644 --- a/src/allmydata/util/iputil.py +++ b/src/allmydata/util/iputil.py @@ -39,7 +39,7 @@ def get_local_addresses_async(target='A.ROOT-SERVERS.NET'): def _collect(res): for addr in res: - if not addr in addresses: + if addr != "0.0.0.0" and not addr in addresses: addresses.append(addr) return addresses d.addCallback(_collect)