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(-)

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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to