aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-12-10 14:58:44 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:55 -0500
commitff052645c939b2fd8d467105adf98fa621cc244b (patch)
tree8f7a3030c8d052952dc08ade77da67395143cd8b
parentc1d35866566bc2b270a82445271fcce1e391c4b9 (diff)
NFS: Change nfs_find_client() to take "struct sockaddr *"
Adjust arguments and callers of nfs_find_client() to pass a "struct sockaddr *" instead of "struct sockaddr_in *" to support non-IPv4 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Trond: Also fix up protocol version number argument in nfs_find_client() to use the correct u32 type. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/callback.c3
-rw-r--r--fs/nfs/callback_proc.c4
-rw-r--r--fs/nfs/client.c7
-rw-r--r--fs/nfs/internal.h2
4 files changed, 5 insertions, 11 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index bbf67f148ff9..9b6bbf1b9787 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -164,12 +164,11 @@ void nfs_callback_down(void)
164 164
165static int nfs_callback_authenticate(struct svc_rqst *rqstp) 165static int nfs_callback_authenticate(struct svc_rqst *rqstp)
166{ 166{
167 struct sockaddr_in *addr = svc_addr_in(rqstp);
168 struct nfs_client *clp; 167 struct nfs_client *clp;
169 char buf[RPC_MAX_ADDRBUFLEN]; 168 char buf[RPC_MAX_ADDRBUFLEN];
170 169
171 /* Don't talk to strangers */ 170 /* Don't talk to strangers */
172 clp = nfs_find_client(addr, 4); 171 clp = nfs_find_client(svc_addr(rqstp), 4);
173 if (clp == NULL) 172 if (clp == NULL)
174 return SVC_DROP; 173 return SVC_DROP;
175 174
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index fa9586dcc3dd..e89a9007c91c 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -25,7 +25,7 @@ __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *
25 25
26 res->bitmap[0] = res->bitmap[1] = 0; 26 res->bitmap[0] = res->bitmap[1] = 0;
27 res->status = htonl(NFS4ERR_BADHANDLE); 27 res->status = htonl(NFS4ERR_BADHANDLE);
28 clp = nfs_find_client((struct sockaddr_in *)args->addr, 4); 28 clp = nfs_find_client(args->addr, 4);
29 if (clp == NULL) 29 if (clp == NULL)
30 goto out; 30 goto out;
31 31
@@ -68,7 +68,7 @@ __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy)
68 __be32 res; 68 __be32 res;
69 69
70 res = htonl(NFS4ERR_BADHANDLE); 70 res = htonl(NFS4ERR_BADHANDLE);
71 clp = nfs_find_client((struct sockaddr_in *)args->addr, 4); 71 clp = nfs_find_client(args->addr, 4);
72 if (clp == NULL) 72 if (clp == NULL)
73 goto out; 73 goto out;
74 74
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 44fe7fd7bfbf..73bf4ecad030 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -242,7 +242,7 @@ static int nfs_sockaddr_match_ipaddr(const struct sockaddr *sa1,
242 * Find a client by IP address and protocol version 242 * Find a client by IP address and protocol version
243 * - returns NULL if no such client 243 * - returns NULL if no such client
244 */ 244 */
245struct nfs_client *_nfs_find_client(const struct sockaddr *addr, int nfsversion) 245struct nfs_client *nfs_find_client(const struct sockaddr *addr, u32 nfsversion)
246{ 246{
247 struct nfs_client *clp; 247 struct nfs_client *clp;
248 248
@@ -272,11 +272,6 @@ struct nfs_client *_nfs_find_client(const struct sockaddr *addr, int nfsversion)
272 return NULL; 272 return NULL;
273} 273}
274 274
275struct nfs_client *nfs_find_client(const struct sockaddr_in *addr, int nfsversion)
276{
277 return _nfs_find_client((const struct sockaddr *)addr, nfsversion);
278}
279
280/* 275/*
281 * Find an nfs_client on the list that matches the initialisation data 276 * Find an nfs_client on the list that matches the initialisation data
282 * that is supplied. 277 * that is supplied.
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 058d503a0ee1..c8458b168018 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -60,7 +60,7 @@ struct nfs_parsed_mount_data {
60extern struct rpc_program nfs_program; 60extern struct rpc_program nfs_program;
61 61
62extern void nfs_put_client(struct nfs_client *); 62extern void nfs_put_client(struct nfs_client *);
63extern struct nfs_client *nfs_find_client(const struct sockaddr_in *, int); 63extern struct nfs_client *nfs_find_client(const struct sockaddr *, u32);
64extern struct nfs_server *nfs_create_server( 64extern struct nfs_server *nfs_create_server(
65 const struct nfs_parsed_mount_data *, 65 const struct nfs_parsed_mount_data *,
66 struct nfs_fh *); 66 struct nfs_fh *);