Don't resolve AAAA records if there is no dnspython nor IPv6 support
If system doesn't has IPv6 support or dnspython package, socket.getaddrinfo with AF_INET6 flag return weird IP info for requested host, making SleekXMPP crush with more weird error.
This commit is contained in:
parent
d439c4f215
commit
556e4bd74d
@ -202,6 +202,9 @@ def get_AAAA(host, resolver=None):
|
||||
# If not using dnspython, attempt lookup using the OS level
|
||||
# getaddrinfo() method.
|
||||
if resolver is None:
|
||||
if not socket.has_ipv6:
|
||||
log.debug("Unable to query %s for AAAA records: IPv6 is not supported", host)
|
||||
return []
|
||||
try:
|
||||
recs = socket.getaddrinfo(host, None, socket.AF_INET6,
|
||||
socket.SOCK_STREAM)
|
||||
|
Loading…
Reference in New Issue
Block a user