summaryrefslogtreecommitdiff
path: root/lib/dnspython/dns/ipv6.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-08-27 16:07:52 +0200
committerJelmer Vernooij <jelmer@samba.org>2011-08-27 17:40:39 +0200
commit8bd71350abe48fdcfc0125e48fa97abdf31e1270 (patch)
tree2873d7fc77f9ec1992e24886a9feae80b48ffaef /lib/dnspython/dns/ipv6.py
parentbd01a8e79faa3d657f01529c063cd0e09d711880 (diff)
downloadsamba-8bd71350abe48fdcfc0125e48fa97abdf31e1270.tar.gz
samba-8bd71350abe48fdcfc0125e48fa97abdf31e1270.tar.bz2
samba-8bd71350abe48fdcfc0125e48fa97abdf31e1270.zip
dnspython: Update to latest upstream snapshot.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Aug 27 17:40:39 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/dnspython/dns/ipv6.py')
-rw-r--r--lib/dnspython/dns/ipv6.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/dnspython/dns/ipv6.py b/lib/dnspython/dns/ipv6.py
index 33c6713796..69db34a7de 100644
--- a/lib/dnspython/dns/ipv6.py
+++ b/lib/dnspython/dns/ipv6.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -89,7 +89,7 @@ def inet_ntoa(address):
hex = ':'.join(chunks)
return hex
-_v4_ending = re.compile(r'(.*):(\d+)\.(\d+)\.(\d+)\.(\d+)$')
+_v4_ending = re.compile(r'(.*):(\d+\.\d+\.\d+\.\d+)$')
_colon_colon_start = re.compile(r'::.*')
_colon_colon_end = re.compile(r'.*::$')
@@ -113,9 +113,9 @@ def inet_aton(text):
#
m = _v4_ending.match(text)
if not m is None:
- text = "%s:%04x:%04x" % (m.group(1),
- int(m.group(2)) * 256 + int(m.group(3)),
- int(m.group(4)) * 256 + int(m.group(5)))
+ b = dns.ipv4.inet_aton(m.group(2))
+ text = "%s:%02x%02x:%02x%02x" % (m.group(1), ord(b[0]), ord(b[1]),
+ ord(b[2]), ord(b[3]))
#
# Try to turn '::<whatever>' into ':<whatever>'; if no match try to
# turn '<whatever>::' into '<whatever>:'