Skip to content
Snippets Groups Projects
Commit da881d49 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Add workaround for (bogus) reverse address lookups

parent 0a28f937
Branches
Tags v0.9.16
No related merge requests found
...@@ -76,9 +76,25 @@ class Unalias: ...@@ -76,9 +76,25 @@ class Unalias:
byaddr.add(sa[0]) byaddr.add(sa[0])
pass pass
self.by_name[host] = set() self.by_name[host] = set()
for name,_,_ in map(socket.gethostbyaddr, byaddr): for addr in byaddr:
# Temporary fix for totally broken design
# we should not rely on reverse lookups since that
# mostly fails for local addresses, we should implemennt
# handling of mirrorlists/metalinks
try:
name,_,_ = socket.gethostbyaddr(addr)
self.by_name[host].add(str(name)) self.by_name[host].add(str(name))
pass pass
except:
pass
pass
pass
if not self.by_name[host]:
# Temporary fix for totally broken design
# we should not rely on reverse lookups since that
# mostly fails for local addresses, we should implemennt
# handling of mirrorlists/metalinks
self.by_name[host].add(host)
pass pass
return sorted(self.by_name[host]) return sorted(self.by_name[host])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment