Skip to content

Commit

Permalink
SUNRPC: compare scopeid for link-local addresses
Browse files Browse the repository at this point in the history
For ipv6 link-local addresses, sunrpc do not compare those scope id.
This patch let sunrpc compares scope id only on link-local addresses.

Signed-off-by: Mi Jinlong <[email protected]>
Reviewed-by: Chuck Lever <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
Mi Jinlong authored and J. Bruce Fields committed Sep 14, 2011
1 parent 849a1cf commit 038c015
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/linux/sunrpc/clnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,13 @@ static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1,
{
const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1;
const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2;
return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);

if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr))
return false;
else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL)
return sin1->sin6_scope_id == sin2->sin6_scope_id;

return true;
}

static inline bool __rpc_copy_addr6(struct sockaddr *dst,
Expand Down

0 comments on commit 038c015

Please sign in to comment.