All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: fix dead code of ipv6_addr_scope
@ 2013-12-21  4:39 ` Alexander Aring
  0 siblings, 0 replies; 13+ messages in thread
From: Alexander Aring @ 2013-12-21  4:39 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs, netdev, werner, Alexander Aring

The correct way to check on IPV6_ADDR_SCOPE_LINKLOCAL is to check with
the ipv6_addr_src_scope function.

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>
---
I think ipv6_addr_src_scope should be correct, can somebody from netdev ml
confirm this please?
I stumple over that and I did not compile and test it. Maybe this is something
for stable?

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

diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index c7c295e5..efac602 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -95,7 +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) ==
+		if (ipv6_addr_src_scope(&a6->sin6_addr) ==
 		    IPV6_ADDR_SCOPE_LINKLOCAL &&
 		    a6->sin6_scope_id != b6->sin6_scope_id)
 			return false;
-- 
1.8.5.2


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

end of thread, other threads:[~2013-12-22 12:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-21  4:39 [PATCH] nfs: fix dead code of ipv6_addr_scope Alexander Aring
2013-12-21  4:39 ` Alexander Aring
2013-12-21  8:17 ` Alexander Aring
2013-12-21 12:44 ` Hannes Frederic Sowa
2013-12-21 12:44   ` Hannes Frederic Sowa
2013-12-21 13:32   ` Alexander Aring
2013-12-21 13:32     ` Alexander Aring
2013-12-22  2:30     ` Hannes Frederic Sowa
2013-12-22  2:30       ` Hannes Frederic Sowa
2013-12-22 12:30       ` Alexander Aring
2013-12-22 12:30         ` Alexander Aring
2013-12-22 12:38         ` Hannes Frederic Sowa
2013-12-22 12:38           ` Hannes Frederic Sowa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.