Commit dcecae0f authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

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: default avatarChuck Lever <chuck.lever@oracle.com>
Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent d7422c47
...@@ -927,15 +927,17 @@ static int nfs4_init_client(struct nfs_client *clp, ...@@ -927,15 +927,17 @@ static int nfs4_init_client(struct nfs_client *clp,
* Set up an NFS4 client * Set up an NFS4 client
*/ */
static int nfs4_set_client(struct nfs_server *server, 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, const char *ip_addr,
rpc_authflavor_t authflavour, rpc_authflavor_t authflavour,
int proto, int timeo, int retrans) int proto, int timeo, int retrans)
{ {
struct nfs_client_initdata cl_init = { struct nfs_client_initdata cl_init = {
.hostname = hostname, .hostname = hostname,
.addr = (const struct sockaddr *)addr, .addr = addr,
.addrlen = sizeof(*addr), .addrlen = addrlen,
.rpc_ops = &nfs_v4_clientops, .rpc_ops = &nfs_v4_clientops,
}; };
struct nfs_client *clp; struct nfs_client *clp;
...@@ -1015,7 +1017,8 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data, ...@@ -1015,7 +1017,8 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data,
/* Get a client record */ /* Get a client record */
error = nfs4_set_client(server, error = nfs4_set_client(server,
data->nfs_server.hostname, data->nfs_server.hostname,
&data->nfs_server.address, (struct sockaddr *)&data->nfs_server.address,
sizeof(data->nfs_server.address),
data->client_address, data->client_address,
data->auth_flavors[0], data->auth_flavors[0],
data->nfs_server.protocol, data->nfs_server.protocol,
...@@ -1090,12 +1093,14 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, ...@@ -1090,12 +1093,14 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
/* Get a client representation. /* Get a client representation.
* Note: NFSv4 always uses TCP, */ * Note: NFSv4 always uses TCP, */
error = nfs4_set_client(server, data->hostname, data->addr, error = nfs4_set_client(server, data->hostname,
parent_client->cl_ipaddr, (struct sockaddr *)data->addr,
data->authflavor, sizeof(*data->addr),
parent_server->client->cl_xprt->prot, parent_client->cl_ipaddr,
parent_client->retrans_timeo, data->authflavor,
parent_client->retrans_count); parent_server->client->cl_xprt->prot,
parent_client->retrans_timeo,
parent_client->retrans_count);
if (error < 0) if (error < 0)
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment