aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-02-12 03:53:35 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:36 -0500
commit73df0dbaff8d0853387e140f52b6250c486b18a1 (patch)
treef1b3a669b47744b982ba5e25af329712abd36bf5
parent27459f0940e16c68e080f5fc7e85aa9eb3f74528 (diff)
[PATCH] knfsd: SUNRPC: Make rq_daddr field address-version independent
The rq_daddr field must support larger addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/sunrpc/svc.h15
-rw-r--r--net/sunrpc/svcsock.c4
2 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 96c1b6ae7d96..6d6892fa1d40 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -11,6 +11,7 @@
11#define SUNRPC_SVC_H 11#define SUNRPC_SVC_H
12 12
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/in6.h>
14#include <linux/sunrpc/types.h> 15#include <linux/sunrpc/types.h>
15#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
16#include <linux/sunrpc/auth.h> 17#include <linux/sunrpc/auth.h>
@@ -191,7 +192,13 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
191 iov->iov_len += sizeof(__be32); 192 iov->iov_len += sizeof(__be32);
192} 193}
193 194
194 195union svc_addr_u {
196 struct in_addr addr;
197#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
198 struct in6_addr addr6;
199#endif
200};
201
195/* 202/*
196 * The context of a single thread, including the request currently being 203 * The context of a single thread, including the request currently being
197 * processed. 204 * processed.
@@ -227,8 +234,8 @@ struct svc_rqst {
227 unsigned short 234 unsigned short
228 rq_secure : 1; /* secure port */ 235 rq_secure : 1; /* secure port */
229 236
230 237 union svc_addr_u rq_daddr; /* dest addr of request
231 __be32 rq_daddr; /* dest addr of request - reply from here */ 238 * - reply from here */
232 239
233 void * rq_argp; /* decoded arguments */ 240 void * rq_argp; /* decoded arguments */
234 void * rq_resp; /* xdr'd results */ 241 void * rq_resp; /* xdr'd results */
@@ -308,7 +315,7 @@ struct svc_deferred_req {
308 struct svc_sock *svsk; 315 struct svc_sock *svsk;
309 struct sockaddr_storage addr; /* where reply must go */ 316 struct sockaddr_storage addr; /* where reply must go */
310 size_t addrlen; 317 size_t addrlen;
311 __be32 daddr; /* where reply must come from */ 318 union svc_addr_u daddr; /* where reply must come from */
312 struct cache_deferred_req handle; 319 struct cache_deferred_req handle;
313 int argslen; 320 int argslen;
314 __be32 args[0]; 321 __be32 args[0];
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index b11669670baa..9d7a819149ce 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -484,7 +484,7 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
484 cmh->cmsg_level = SOL_IP; 484 cmh->cmsg_level = SOL_IP;
485 cmh->cmsg_type = IP_PKTINFO; 485 cmh->cmsg_type = IP_PKTINFO;
486 pki->ipi_ifindex = 0; 486 pki->ipi_ifindex = 0;
487 pki->ipi_spec_dst.s_addr = rqstp->rq_daddr; 487 pki->ipi_spec_dst.s_addr = rqstp->rq_daddr.addr.s_addr;
488 488
489 if (sock_sendmsg(sock, &msg, 0) < 0) 489 if (sock_sendmsg(sock, &msg, 0) < 0)
490 goto out; 490 goto out;
@@ -763,7 +763,7 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
763 rqstp->rq_addrlen = sizeof(struct sockaddr_in); 763 rqstp->rq_addrlen = sizeof(struct sockaddr_in);
764 764
765 /* Remember which interface received this request */ 765 /* Remember which interface received this request */
766 rqstp->rq_daddr = skb->nh.iph->daddr; 766 rqstp->rq_daddr.addr.s_addr = skb->nh.iph->daddr;
767 767
768 if (skb_is_nonlinear(skb)) { 768 if (skb_is_nonlinear(skb)) {
769 /* we have to copy */ 769 /* we have to copy */