diff options
author | Mi Jinlong <mijinlong@cn.fujitsu.com> | 2011-08-30 05:22:49 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-09-14 08:22:02 -0400 |
commit | 038c01598e728cda5b2996c4bf883e8485b2fe50 (patch) | |
tree | 6d2dbb22183d308fd3e85ddfea2286f0e77b99af /include | |
parent | 849a1cf13d4394d398d91752166e92e9ecd64f8d (diff) |
SUNRPC: compare scopeid for link-local addresses
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 <mijinlong@cn.fujitsu.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/clnt.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index db7bcaf7c5bd..ee1bb67f525e 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -218,7 +218,13 @@ static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | |||
218 | { | 218 | { |
219 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | 219 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; |
220 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | 220 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; |
221 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | 221 | |
222 | if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr)) | ||
223 | return false; | ||
224 | else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL) | ||
225 | return sin1->sin6_scope_id == sin2->sin6_scope_id; | ||
226 | |||
227 | return true; | ||
222 | } | 228 | } |
223 | 229 | ||
224 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | 230 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, |