]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
filter out "0.0.0.0" from detected IP addresses
authorZooko O'Whielacronx <zooko@zooko.com>
Sat, 13 Oct 2007 07:38:16 +0000 (00:38 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Sat, 13 Oct 2007 07:38:16 +0000 (00:38 -0700)
src/allmydata/test/test_iputil.py
src/allmydata/util/iputil.py

index 3a06b4cdb0a7c949542809f193d8b01d759c9cf6..0f16f72c31559aef9069b64593f51f5ee3799ff9 100644 (file)
@@ -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
index db6d240ba4df6973f7f0c99e632f76be137e22c2..d7f4de457f3b0b5df4be505ebd71876489278d18 100644 (file)
@@ -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)