ipv6: fix ipv6_prefix_equal64_half mask conversion
authorFabio Baltieri <fabio.baltieri@linaro.org>
Wed, 16 Jan 2013 21:30:17 +0000 (22:30 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jan 2013 19:29:58 +0000 (14:29 -0500)
Fix the 64bit optimized version of ipv6_prefix_equal to convert the
bitmask to network byte order only after the bit-shift.

The bug was introduced in:

3867517 ipv6: 64bit version of ipv6_prefix_equal().

Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ipv6.h

index 51a068ad064b0288c86384ba5a72a65f39f19515..464c6f70eca16b7f20fc4b17f8f40914712462e8 100644 (file)
@@ -404,7 +404,7 @@ static inline bool __ipv6_prefix_equal64_half(const __be64 *a1,
                                              const __be64 *a2,
                                              unsigned int len)
 {
-       if (len && ((*a1 ^ *a2) & cpu_to_be64(~0UL) << (64 - len)))
+       if (len && ((*a1 ^ *a2) & cpu_to_be64((~0UL) << (64 - len))))
                return false;
        return true;
 }