diff options
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 8 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 32 |
2 files changed, 29 insertions, 11 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, |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 223588a976a0..d8d5d93071b3 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -212,11 +212,6 @@ static inline void svc_putu32(struct kvec *iov, __be32 val) | |||
| 212 | iov->iov_len += sizeof(__be32); | 212 | iov->iov_len += sizeof(__be32); |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | union svc_addr_u { | ||
| 216 | struct in_addr addr; | ||
| 217 | struct in6_addr addr6; | ||
| 218 | }; | ||
| 219 | |||
| 220 | /* | 215 | /* |
| 221 | * The context of a single thread, including the request currently being | 216 | * The context of a single thread, including the request currently being |
| 222 | * processed. | 217 | * processed. |
| @@ -225,8 +220,12 @@ struct svc_rqst { | |||
| 225 | struct list_head rq_list; /* idle list */ | 220 | struct list_head rq_list; /* idle list */ |
| 226 | struct list_head rq_all; /* all threads list */ | 221 | struct list_head rq_all; /* all threads list */ |
| 227 | struct svc_xprt * rq_xprt; /* transport ptr */ | 222 | struct svc_xprt * rq_xprt; /* transport ptr */ |
| 223 | |||
| 228 | struct sockaddr_storage rq_addr; /* peer address */ | 224 | struct sockaddr_storage rq_addr; /* peer address */ |
| 229 | size_t rq_addrlen; | 225 | size_t rq_addrlen; |
| 226 | struct sockaddr_storage rq_daddr; /* dest addr of request | ||
| 227 | * - reply from here */ | ||
| 228 | size_t rq_daddrlen; | ||
| 230 | 229 | ||
| 231 | struct svc_serv * rq_server; /* RPC service definition */ | 230 | struct svc_serv * rq_server; /* RPC service definition */ |
| 232 | struct svc_pool * rq_pool; /* thread pool */ | 231 | struct svc_pool * rq_pool; /* thread pool */ |
| @@ -255,9 +254,6 @@ struct svc_rqst { | |||
| 255 | unsigned short | 254 | unsigned short |
| 256 | rq_secure : 1; /* secure port */ | 255 | rq_secure : 1; /* secure port */ |
| 257 | 256 | ||
| 258 | union svc_addr_u rq_daddr; /* dest addr of request | ||
| 259 | * - reply from here */ | ||
| 260 | |||
| 261 | void * rq_argp; /* decoded arguments */ | 257 | void * rq_argp; /* decoded arguments */ |
| 262 | void * rq_resp; /* xdr'd results */ | 258 | void * rq_resp; /* xdr'd results */ |
| 263 | void * rq_auth_data; /* flavor-specific data */ | 259 | void * rq_auth_data; /* flavor-specific data */ |
| @@ -300,6 +296,21 @@ static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst) | |||
| 300 | return (struct sockaddr *) &rqst->rq_addr; | 296 | return (struct sockaddr *) &rqst->rq_addr; |
| 301 | } | 297 | } |
| 302 | 298 | ||
| 299 | static inline struct sockaddr_in *svc_daddr_in(const struct svc_rqst *rqst) | ||
| 300 | { | ||
| 301 | return (struct sockaddr_in *) &rqst->rq_daddr; | ||
| 302 | } | ||
| 303 | |||
| 304 | static inline struct sockaddr_in6 *svc_daddr_in6(const struct svc_rqst *rqst) | ||
| 305 | { | ||
| 306 | return (struct sockaddr_in6 *) &rqst->rq_daddr; | ||
| 307 | } | ||
| 308 | |||
| 309 | static inline struct sockaddr *svc_daddr(const struct svc_rqst *rqst) | ||
| 310 | { | ||
| 311 | return (struct sockaddr *) &rqst->rq_daddr; | ||
| 312 | } | ||
| 313 | |||
| 303 | /* | 314 | /* |
| 304 | * Check buffer bounds after decoding arguments | 315 | * Check buffer bounds after decoding arguments |
| 305 | */ | 316 | */ |
| @@ -340,7 +351,8 @@ struct svc_deferred_req { | |||
| 340 | struct svc_xprt *xprt; | 351 | struct svc_xprt *xprt; |
| 341 | struct sockaddr_storage addr; /* where reply must go */ | 352 | struct sockaddr_storage addr; /* where reply must go */ |
| 342 | size_t addrlen; | 353 | size_t addrlen; |
| 343 | union svc_addr_u daddr; /* where reply must come from */ | 354 | struct sockaddr_storage daddr; /* where reply must come from */ |
| 355 | size_t daddrlen; | ||
| 344 | struct cache_deferred_req handle; | 356 | struct cache_deferred_req handle; |
| 345 | size_t xprt_hlen; | 357 | size_t xprt_hlen; |
| 346 | int argslen; | 358 | int argslen; |
| @@ -404,7 +416,7 @@ struct svc_procedure { | |||
| 404 | struct svc_serv *svc_create(struct svc_program *, unsigned int, | 416 | struct svc_serv *svc_create(struct svc_program *, unsigned int, |
| 405 | void (*shutdown)(struct svc_serv *)); | 417 | void (*shutdown)(struct svc_serv *)); |
| 406 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, | 418 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, |
| 407 | struct svc_pool *pool); | 419 | struct svc_pool *pool, int node); |
| 408 | void svc_exit_thread(struct svc_rqst *); | 420 | void svc_exit_thread(struct svc_rqst *); |
| 409 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, | 421 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, |
| 410 | void (*shutdown)(struct svc_serv *), | 422 | void (*shutdown)(struct svc_serv *), |
