Skip to content

Commit a21be1f

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: match even the scope id for ipv6 addresses
match_address function matches the scope id for ipv6 addresses, but cifs_match_ipaddr (which is another function used for comparison) does not use scope id. Doing so with this change. Signed-off-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 4bd3e4c commit a21be1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/cifs/connect.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,8 @@ cifs_match_ipaddr(struct sockaddr *srcaddr, struct sockaddr *rhs)
12941294
case AF_INET6: {
12951295
struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *)srcaddr;
12961296
struct sockaddr_in6 *vaddr6 = (struct sockaddr_in6 *)rhs;
1297-
return ipv6_addr_equal(&saddr6->sin6_addr, &vaddr6->sin6_addr);
1297+
return (ipv6_addr_equal(&saddr6->sin6_addr, &vaddr6->sin6_addr)
1298+
&& saddr6->sin6_scope_id == vaddr6->sin6_scope_id);
12981299
}
12991300
default:
13001301
WARN_ON(1);

0 commit comments

Comments
 (0)