]> git.itanic.dy.fi Git - linux-stable/commitdiff
nfs: fix dead code of ipv6_addr_scope
authorAlexander Aring <alex.aring@gmail.com>
Sat, 21 Dec 2013 04:39:04 +0000 (05:39 +0100)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Apr 2014 08:32:14 +0000 (10:32 +0200)
commit a8c2275493b866961f4429a741251c630c4fc6d7 upstream.

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>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nfs/nfs4filelayoutdev.c

index c7c295e556ed87501c069053d0c133e44dcadc97..efac602edb37027a944601621baa8361c09f9fc9 100644 (file)
@@ -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;