aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-02-12 03:53:34 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:36 -0500
commit27459f0940e16c68e080f5fc7e85aa9eb3f74528 (patch)
treef13cd1f2005dda2b6115e2afbc49e1271b0d374b /fs/lockd
parent2442222283918c2d1c20ae651d95fe168757938b (diff)
[PATCH] knfsd: SUNRPC: Provide room in svc_rqst for larger addresses
Expand the rq_addr field to allow it to contain larger addresses. Specifically, we replace a 'sockaddr_in' with a 'sockaddr_storage', then everywhere the 'sockaddr_in' was referenced, we use instead an accessor function (svc_addr_in) which safely casts the _storage to _in. 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>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/host.c2
-rw-r--r--fs/lockd/svc4proc.c6
-rw-r--r--fs/lockd/svcproc.c6
3 files changed, 9 insertions, 5 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 3d4610c2a266..22d403208973 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -192,7 +192,7 @@ struct nlm_host *
192nlmsvc_lookup_host(struct svc_rqst *rqstp, 192nlmsvc_lookup_host(struct svc_rqst *rqstp,
193 const char *hostname, int hostname_len) 193 const char *hostname, int hostname_len)
194{ 194{
195 return nlm_lookup_host(1, &rqstp->rq_addr, 195 return nlm_lookup_host(1, svc_addr_in(rqstp),
196 rqstp->rq_prot, rqstp->rq_vers, 196 rqstp->rq_prot, rqstp->rq_vers,
197 hostname, hostname_len); 197 hostname, hostname_len);
198} 198}
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 9b591bc18341..47a66aa5d55b 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -224,7 +224,7 @@ nlm4svc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
224 resp->cookie = argp->cookie; 224 resp->cookie = argp->cookie;
225 225
226 dprintk("lockd: GRANTED called\n"); 226 dprintk("lockd: GRANTED called\n");
227 resp->status = nlmclnt_grant(&rqstp->rq_addr, &argp->lock); 227 resp->status = nlmclnt_grant(svc_addr_in(rqstp), &argp->lock);
228 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status)); 228 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status));
229 return rpc_success; 229 return rpc_success;
230} 230}
@@ -421,7 +421,9 @@ static __be32
421nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, 421nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
422 void *resp) 422 void *resp)
423{ 423{
424 struct sockaddr_in saddr = rqstp->rq_addr; 424 struct sockaddr_in saddr;
425
426 memcpy(&saddr, svc_addr_in(rqstp), sizeof(saddr));
425 427
426 dprintk("lockd: SM_NOTIFY called\n"); 428 dprintk("lockd: SM_NOTIFY called\n");
427 if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK) 429 if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index f590304d93bf..31cb48425733 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -253,7 +253,7 @@ nlmsvc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
253 resp->cookie = argp->cookie; 253 resp->cookie = argp->cookie;
254 254
255 dprintk("lockd: GRANTED called\n"); 255 dprintk("lockd: GRANTED called\n");
256 resp->status = nlmclnt_grant(&rqstp->rq_addr, &argp->lock); 256 resp->status = nlmclnt_grant(svc_addr_in(rqstp), &argp->lock);
257 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status)); 257 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status));
258 return rpc_success; 258 return rpc_success;
259} 259}
@@ -452,7 +452,9 @@ static __be32
452nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, 452nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
453 void *resp) 453 void *resp)
454{ 454{
455 struct sockaddr_in saddr = rqstp->rq_addr; 455 struct sockaddr_in saddr;
456
457 memcpy(&saddr, svc_addr_in(rqstp), sizeof(saddr));
456 458
457 dprintk("lockd: SM_NOTIFY called\n"); 459 dprintk("lockd: SM_NOTIFY called\n");
458 if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK) 460 if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)