summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid P. D. Moss <drkjam@gmail.com>2009-06-20 09:14:22 +0000
committerDavid P. D. Moss <drkjam@gmail.com>2009-06-20 09:14:22 +0000
commitd34f24bfd8e568f01c2767b10f00643631784d6c (patch)
treea65351d3f8835af33e4a09cfc1d5d0fefbd6e763
parentf2a5f97f278c97e0effd7a414dc5af787108d98d (diff)
downloadnetaddr-d34f24bfd8e568f01c2767b10f00643631784d6c.tar.gz
Fixed issue 37.
-rw-r--r--CHANGELOG34
-rwxr-xr-xnetaddr/address.py2
-rwxr-xr-xtests/ut_netaddr.py5
3 files changed, 38 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 3c65023..a39576e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,35 @@
+Release: 0.6.3
+Date: TBC
+
+Major changes since 0.6.2
+-------------------------
+
+* Fixed line endings in a number of new files created under Windows.
+
+* Tweaked the ordering of values in tuple passed into the hash() function in
+ the __hash__ method of the IP and IPRange classes to make it the same as
+ the values used for comparisons implemented in the __eq__ method (Python
+ best practice).
+
+Specific bug fixes addressed in this release
+--------------------------------------------
+
+* FIXED Issue 35 - http://code.google.com/p/netaddr/issues/detail?id=32
+
+ - install error (on Python interpreters where socket.has_ipv6 is False)
+
+* FIXED Issue 36 - http://code.google.com/p/netaddr/issues/detail?id=36
+
+ - netaddr.CIDR fails to parse default route CIDR
+
+* FIXED Issue 37 - http://code.google.com/p/netaddr/issues/detail?id=37
+
+ - Bug in bitwise AND operator for IP addresses
+
+------------------------------------------------------------------------------
+
Release: 0.6.2
-Date: 13th Apr 2008
+Date: 13th Apr 2009
Major changes since 0.6.1
-------------------------
@@ -26,7 +56,7 @@ Specific bug fixes addressed in this release
------------------------------------------------------------------------------
Release: 0.6.1
-Date: 6th Apr 2008
+Date: 6th Apr 2009
Major changes since 0.6
-----------------------
diff --git a/netaddr/address.py b/netaddr/address.py
index 56cb232..3a52f0c 100755
--- a/netaddr/address.py
+++ b/netaddr/address.py
@@ -465,7 +465,7 @@ class Addr(object):
@return: bitwise AND (x & y) of self.value with other.value.
"""
- return self.__class__(self.value | other.value, self.addr_type)
+ return self.__class__(self.value & other.value, self.addr_type)
def __xor__(self, other):
"""
diff --git a/tests/ut_netaddr.py b/tests/ut_netaddr.py
index 01f8541..1937e9d 100755
--- a/tests/ut_netaddr.py
+++ b/tests/ut_netaddr.py
@@ -2578,6 +2578,11 @@ class FullCoverage(TestCase):
mac = EUI('00-00-00-00-00-00')
self.assertRaises(TypeError, mac.__iadd__, 'foo')
+ def testAddrBitwiseOperators(self):
+ ip = IP('192.168.1.1')
+ netmask = IP('255.255.255.0')
+ self.assertEqual(ip & netmask, IP('192.168.1.0'))
+
#-----------------------------------------------------------------------------
if __name__ == '__main__':
unit_test_suite = TestSuite()