linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] nfs: fix dead code of ipv6_addr_scope
@ 2013-12-22 23:01 Alexander Aring
  2013-12-23  3:18 ` Hannes Frederic Sowa
  2013-12-24 17:35 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Aring @ 2013-12-22 23:01 UTC (permalink / raw)
  To: hannes; +Cc: linux-nfs, netdev, stable, werner, Alexander Aring

This patch corrects the check on a linklocal address.

Currently this can't be work, because ipv6_addr_scope returns a int with
a mask of IPV6_ADDR_SCOPE_MASK (0x00f0U) and IPV6_ADDR_SCOPE_LINKLOCAL
is 0x02. So the condition is always false.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
- change check on linklocal address from
  (ipv6_addr_src_scope(&a6->sin6_addr) == IPV6_ADDR_SCOPE_LINKLOCAL) to
  (ipv6_addr_scope(&a6->sin6_addr) & IPV6_ADDR_LINKLOCAL) which is a
  little bit faster.
- change commit msg.

 fs/nfs/nfs4filelayoutdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index c7c295e5..dc5e9e1 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -95,8 +95,7 @@ same_sockaddr(struct sockaddr *addr1, struct sockaddr *addr2)
 		b6 = (struct sockaddr_in6 *)addr2;
 
 		/* LINKLOCAL addresses must have matching scope_id */
-		if (ipv6_addr_scope(&a6->sin6_addr) ==
-		    IPV6_ADDR_SCOPE_LINKLOCAL &&
+		if (ipv6_addr_scope(&a6->sin6_addr) & IPV6_ADDR_LINKLOCAL &&
 		    a6->sin6_scope_id != b6->sin6_scope_id)
 			return false;
 
-- 
1.8.5.2


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

* Re: [PATCH v2] nfs: fix dead code of ipv6_addr_scope
  2013-12-22 23:01 [PATCH v2] nfs: fix dead code of ipv6_addr_scope Alexander Aring
@ 2013-12-23  3:18 ` Hannes Frederic Sowa
  2013-12-24 17:35 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Frederic Sowa @ 2013-12-23  3:18 UTC (permalink / raw)
  To: Alexander Aring; +Cc: linux-nfs, netdev, stable, werner

On Mon, Dec 23, 2013 at 12:01:16AM +0100, Alexander Aring wrote:
> This patch corrects the check on a linklocal address.
> 
> Currently this can't be work, because ipv6_addr_scope returns a int with
> a mask of IPV6_ADDR_SCOPE_MASK (0x00f0U) and IPV6_ADDR_SCOPE_LINKLOCAL
> is 0x02. So the condition is always false.
> 
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>

Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>


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

* Re: [PATCH v2] nfs: fix dead code of ipv6_addr_scope
  2013-12-22 23:01 [PATCH v2] nfs: fix dead code of ipv6_addr_scope Alexander Aring
  2013-12-23  3:18 ` Hannes Frederic Sowa
@ 2013-12-24 17:35 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2013-12-24 17:35 UTC (permalink / raw)
  To: Alexander Aring; +Cc: hannes, linux-nfs, netdev, stable, werner

On Mon, Dec 23, 2013 at 12:01:16AM +0100, Alexander Aring wrote:
> This patch corrects the check on a linklocal address.
> 
> Currently this can't be work, because ipv6_addr_scope returns a int with
> a mask of IPV6_ADDR_SCOPE_MASK (0x00f0U) and IPV6_ADDR_SCOPE_LINKLOCAL
> is 0x02. So the condition is always false.
> 
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
> - change check on linklocal address from
>   (ipv6_addr_src_scope(&a6->sin6_addr) == IPV6_ADDR_SCOPE_LINKLOCAL) to
>   (ipv6_addr_scope(&a6->sin6_addr) & IPV6_ADDR_LINKLOCAL) which is a
>   little bit faster.
> - change commit msg.

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

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

end of thread, other threads:[~2013-12-24 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-22 23:01 [PATCH v2] nfs: fix dead code of ipv6_addr_scope Alexander Aring
2013-12-23  3:18 ` Hannes Frederic Sowa
2013-12-24 17:35 ` Greg KH

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