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 <chuck.lever@oracle.com>
Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net>
---
fs/nfs/client.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 5e53892..37b63a6 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -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,
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Andi Kleen | [PATCH x86] [0/16] Various i386/x86-64 changes |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Pavel Roskin | ndiswrapper and GPL-only symbols redux |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Arjan van de Ven | Re: [GIT]: Networking |
