diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-05-26 16:39:29 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-05-26 16:39:29 +0200 |
commit | dd71b25a6e82d523e9c841428b43d5270d0435af (patch) | |
tree | d5e5c7532486063ae0ce11ec2e8e252eb6f48f23 | |
parent | 0190ceb88992acf6b1e3d8cd6cb29c45b4b78470 (diff) |
Better check for IPv6 addresses.
-rw-r--r-- | ipv6.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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): |