summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-05-26 16:39:29 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-05-26 16:39:29 +0200
commitdd71b25a6e82d523e9c841428b43d5270d0435af (patch)
treed5e5c7532486063ae0ce11ec2e8e252eb6f48f23
parent0190ceb88992acf6b1e3d8cd6cb29c45b4b78470 (diff)
Better check for IPv6 addresses.
-rw-r--r--ipv6.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipv6.py b/ipv6.py
index 12562c9..9dd1f32 100644
--- a/ipv6.py
+++ b/ipv6.py
@@ -46,10 +46,11 @@ class Client(tcp.Client):
)
def resolvedAddress(self, addr):
- aaaa = addr[0][-1].payload
- if aaaa.fancybasename != 'AAAA':
+ aaaas = [x for x in addr[0] if x.type == 28] # 28 = AAAA record
+ if not len(aaaas):
self.failIfNotConnected(Exception('Unable to resolve IPv6 address.'))
return
+ aaaa = aaaas[0].payload
self._setRealAddress(aaaa._address)
def getHost(self):