summaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
authorpmoody@google.com <pmoody@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2010-05-30 05:33:14 +0000
committerpmoody@google.com <pmoody@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2010-05-30 05:33:14 +0000
commit3f2764407b49f0352d465a9f02fbff29596ee68a (patch)
treef5ae9530bd14bbe62da80c19a9f9050cc048eacf /trunk
parent1368c60abd0184343730c125de9d279db193a455 (diff)
downloadipaddr-py-3f2764407b49f0352d465a9f02fbff29596ee68a.tar.gz
+ fix ipv6 subnet representation. (thanks to email from jared
to ipaddr-py-dev) git-svn-id: https://ipaddr-py.googlecode.com/svn@167 09200d28-7f98-11dd-ad27-0f66e57d2035
Diffstat (limited to 'trunk')
-rw-r--r--trunk/ipaddr.py4
-rwxr-xr-xtrunk/ipaddr_test.py8
2 files changed, 9 insertions, 3 deletions
diff --git a/trunk/ipaddr.py b/trunk/ipaddr.py
index 5f3a15b..78f6b63 100644
--- a/trunk/ipaddr.py
+++ b/trunk/ipaddr.py
@@ -1876,3 +1876,7 @@ class IPv6Network(_BaseV6, _BaseNet):
except ValueError:
return False
return 0 <= prefixlen <= 128
+
+ @property
+ def with_netmask(self):
+ return self.with_prefixlen
diff --git a/trunk/ipaddr_test.py b/trunk/ipaddr_test.py
index 90a12e0..37880aa 100755
--- a/trunk/ipaddr_test.py
+++ b/trunk/ipaddr_test.py
@@ -920,10 +920,12 @@ class IpaddrUnitTest(unittest.TestCase):
self.assertEqual(str(self.ipv6.with_prefixlen),
'2001:658:22a:cafe:200::1/64')
- # these two probably don't make much sense, but they're included for
- # compatability with ipv4
+ # rfc3513 sec 2.3 says that ipv6 only uses cidr notation for
+ # subnets
self.assertEqual(str(self.ipv6.with_netmask),
- '2001:658:22a:cafe:200::1/ffff:ffff:ffff:ffff::')
+ '2001:658:22a:cafe:200::1/64')
+ # this probably don't make much sense, but it's included for
+ # compatability with ipv4
self.assertEqual(str(self.ipv6.with_hostmask),
'2001:658:22a:cafe:200::1/::ffff:ffff:ffff:ffff')