diff options
author | Mi Jinlong <mijinlong@cn.fujitsu.com> | 2011-08-30 05:18:41 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-09-14 08:21:48 -0400 |
commit | 849a1cf13d4394d398d91752166e92e9ecd64f8d (patch) | |
tree | 475c08721cb327b924035144f771dd2d85eda0cd /include/linux/sunrpc/svc.h | |
parent | 11fcee0293a6d9f0973e04f8b3fb6cd15a55bcce (diff) |
SUNRPC: Replace svc_addr_u by sockaddr_storage
For IPv6 local address, lockd can not callback to client for
missing scope id when binding address at inet6_bind:
324 if (addr_type & IPV6_ADDR_LINKLOCAL) {
325 if (addr_len >= sizeof(struct sockaddr_in6) &&
326 addr->sin6_scope_id) {
327 /* Override any existing binding, if another one
328 * is supplied by user.
329 */
330 sk->sk_bound_dev_if = addr->sin6_scope_id;
331 }
332
333 /* Binding to link-local address requires an interface */
334 if (!sk->sk_bound_dev_if) {
335 err = -EINVAL;
336 goto out_unlock;
337 }
Replacing svc_addr_u by sockaddr_storage, let rqstp->rq_daddr contains more info
besides address.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'include/linux/sunrpc/svc.h')
-rw-r--r-- | include/linux/sunrpc/svc.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index a78a51e93373..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; |