From af0edec7530333395da5f10c0768f308210e48c6 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Sat, 13 Oct 2007 00:38:16 -0700 Subject: [PATCH] filter out "0.0.0.0" from detected IP addresses --- src/allmydata/test/test_iputil.py | 1 + src/allmydata/util/iputil.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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) -- 2.45.2