netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion
@ 2013-01-16 21:30 Fabio Baltieri
  2013-01-16 21:37 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Baltieri @ 2013-01-16 21:30 UTC (permalink / raw)
  To: netdev, David S. Miller, Hideaki YOSHIFUJI
  Cc: linux-kernel, Alexey Kuznetsov, James Morris, Patrick McHardy,
	Fabio Baltieri

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>
---
 include/net/ipv6.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index dfc1363..459a5a4 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -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;
 }
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion
  2013-01-16 21:30 [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion Fabio Baltieri
@ 2013-01-16 21:37 ` David Miller
  2013-01-17  3:36   ` YOSHIFUJI Hideaki
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2013-01-16 21:37 UTC (permalink / raw)
  To: fabio.baltieri; +Cc: netdev, yoshfuji, linux-kernel, kuznet, jmorris, kaber

From: Fabio Baltieri <fabio.baltieri@linaro.org>
Date: Wed, 16 Jan 2013 22:30:17 +0100

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion
  2013-01-16 21:37 ` David Miller
@ 2013-01-17  3:36   ` YOSHIFUJI Hideaki
  2013-01-17  3:50     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: YOSHIFUJI Hideaki @ 2013-01-17  3:36 UTC (permalink / raw)
  To: David Miller; +Cc: YOSHIFUJI Hideaki, netdev

David Miller wrote:
> From: Fabio Baltieri <fabio.baltieri@linaro.org>
> Date: Wed, 16 Jan 2013 22:30:17 +0100
> 
>> 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>
> 
> Applied, thanks.
> 

Sorry for the mess.

I'm not seeing this in net-next so far, though I can see my
patch for ip6_flow_hdr() which you "applied" later.
Do I miss something?

--yoshfuji

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion
  2013-01-17  3:36   ` YOSHIFUJI Hideaki
@ 2013-01-17  3:50     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-01-17  3:50 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev

From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Thu, 17 Jan 2013 12:36:30 +0900

> I'm not seeing this in net-next so far, though I can see my
> patch for ip6_flow_hdr() which you "applied" later.
> Do I miss something?

It's sitting in my local GIT tree on a machine I use during the day at
an office, I forgot to push some changes out before I headed home.

I'll fix it up tomorrow.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-17  3:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 21:30 [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion Fabio Baltieri
2013-01-16 21:37 ` David Miller
2013-01-17  3:36   ` YOSHIFUJI Hideaki
2013-01-17  3:50     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).