summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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):