From dd71b25a6e82d523e9c841428b43d5270d0435af Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 26 May 2010 16:39:29 +0200 Subject: Better check for IPv6 addresses. --- ipv6.py | 5 +++-- 1 file 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): -- cgit v1.2.3