summaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-12-10 14:58:59 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:56 -0500
commitdcecae0ff44dceea7adb6bef5c8eb660fe87a93c (patch)
treebd17c6708b58eb1f00be2057ed662a53eeb192cd /fs/nfs/client.c
parentd7422c472bbaa419876b91e8823c6219c4a144cb (diff)
NFS: Change nfs4_set_client() to accept struct sockaddr *
Adjust the arguments and callers of nfs4_set_client() to pass a "struct sockaddr *" instead of a "struct sockaddr_in *" to support non-IPv4 addresses in the NFS client. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index e43072bdbb0..11380601fc7 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -927,15 +927,17 @@ error:
* Set up an NFS4 client
*/
static int nfs4_set_client(struct nfs_server *server,
- const char *hostname, const struct sockaddr_in *addr,
+ const char *hostname,
+ const struct sockaddr *addr,
+ const size_t addrlen,
const char *ip_addr,
rpc_authflavor_t authflavour,
int proto, int timeo, int retrans)
{
struct nfs_client_initdata cl_init = {
.hostname = hostname,
- .addr = (const struct sockaddr *)addr,
- .addrlen = sizeof(*addr),
+ .addr = addr,
+ .addrlen = addrlen,
.rpc_ops = &nfs_v4_clientops,
};
struct nfs_client *clp;
@@ -1015,7 +1017,8 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data,
/* Get a client record */
error = nfs4_set_client(server,
data->nfs_server.hostname,
- &data->nfs_server.address,
+ (struct sockaddr *)&data->nfs_server.address,
+ sizeof(data->nfs_server.address),
data->client_address,
data->auth_flavors[0],
data->nfs_server.protocol,
@@ -1090,12 +1093,14 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
/* Get a client representation.
* Note: NFSv4 always uses TCP, */
- error = nfs4_set_client(server, data->hostname, data->addr,
- parent_client->cl_ipaddr,
- data->authflavor,
- parent_server->client->cl_xprt->prot,
- parent_client->retrans_timeo,
- parent_client->retrans_count);
+ error = nfs4_set_client(server, data->hostname,
+ (struct sockaddr *)data->addr,
+ sizeof(*data->addr),
+ parent_client->cl_ipaddr,
+ data->authflavor,
+ parent_server->client->cl_xprt->prot,
+ parent_client->retrans_timeo,
+ parent_client->retrans_count);
if (error < 0)
goto error;