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>
* Set up an NFS4 client
*/
static int nfs4_set_client(struct nfs_server *server,
* 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,
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;
.rpc_ops = &nfs_v4_clientops,
};
struct nfs_client *clp;
/* Get a client record */
error = nfs4_set_client(server,
data->nfs_server.hostname,
/* 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,
data->client_address,
data->auth_flavors[0],
data->nfs_server.protocol,
/* Get a client representation.
* Note: NFSv4 always uses TCP, */
/* 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;
if (error < 0)
goto error;