NFS: Change nfs4_set_client() to accept (sockaddr *, len)
Subsystems (4)
PATCH 17/25 NFS: Change nfs4_set_client() to accept (sockaddr *, len)
Adjust the arguments and callers of nfs4_set_client() to pass a "struct sockaddr *" and a length instead of a "struct sockaddr_in *" to support non-IPv4 addresses in the NFS client.
Signed-off-by Chuck Lever <[email protected]>
Cc Aurelien Charbon <[email protected]>
---
fs/nfs/client.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
fs/nfs/client.c +8 -5
@@ -914,7 +914,9 @@ 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)
@@ -925,8 +927,7 @@ static int nfs4_set_client(struct nfs_server *server,dprintk ("--> nfs4_set_client()\n" );/* Allocate or find a client reference we can use */ - clp =nfs_get_client (hostname, (struct sockaddr *)addr, -sizeof (*addr),4 ); + clp =nfs_get_client (hostname, addr, addrlen,4 );if (IS_ERR (clp)) { error =PTR_ERR (clp); goto error;
@@ -997,7 +998,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,
@@ -1073,7 +1075,8 @@ 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, - (struct sockaddr_in *)data->addr, + data->addr, + sizeof(*data->addr), parent_client->cl_ipaddr, data->authflavor, parent_server->client->cl_xprt->prot,
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs