Skip to content

Commit

Permalink
ipv6: fix ipv6_prefix_equal64_half mask conversion
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fabio Baltieri authored and David S. Miller committed Jan 17, 2013
1 parent c2a9366 commit 512613d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 512613d

Please sign in to comment.