Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6677d09513e35ac2f38d3a8c8a26fbd7bbcef192
Commit:     6677d09513e35ac2f38d3a8c8a26fbd7bbcef192
Parent:     dcecae0ff44dceea7adb6bef5c8eb660fe87a93c
Author:     Chuck Lever <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 10 14:59:06 2007 -0500
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 02:05:56 2008 -0500

    NFS: Adjust nfs_clone_mount structure to store "struct sockaddr *"
    
    Change the addr field in the nfs_clone_mount structure to store a "struct
    sockaddr *" to support non-IPv4 addresses in the NFS client.
    
    Note this is mostly a cosmetic change, and does not actually allow
    referrals using IPv6 addresses.  The existing referral code assumes that
    the server returns a string that represents an IPv4 address.  This code
    needs to support hostnames and IPv6 addresses as well as IPv4 addresses,
    thus it will need to be reorganized completely (to handle DNS resolution
    in user space).
    
    Signed-off-by: Chuck Lever <[EMAIL PROTECTED]>
    Cc: Aurelien Charbon <[EMAIL PROTECTED]>
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/client.c        |    4 ++--
 fs/nfs/internal.h      |    3 ++-
 fs/nfs/nfs4namespace.c |   12 +++++++-----
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 1138060..ba114fa 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1094,8 +1094,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 *)data->addr,
-                               sizeof(*data->addr),
+                               data->addr,
+                               data->addrlen,
                                parent_client->cl_ipaddr,
                                data->authflavor,
                                parent_server->client->cl_xprt->prot,
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index c8458b1..75dd4e2 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -21,7 +21,8 @@ struct nfs_clone_mount {
        struct nfs_fattr *fattr;
        char *hostname;
        char *mnt_path;
-       struct sockaddr_in *addr;
+       struct sockaddr *addr;
+       size_t addrlen;
        rpc_authflavor_t authflavor;
 };
 
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index bd1b161..5f9ba41 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -172,7 +172,10 @@ static struct vfsmount *nfs_follow_referral(const struct 
vfsmount *mnt_parent,
 
                s = 0;
                while (s < location->nservers) {
-                       struct sockaddr_in addr = {};
+                       struct sockaddr_in addr = {
+                               .sin_family     = AF_INET,
+                               .sin_port       = htons(NFS_PORT),
+                       };
 
                        if (location->servers[s].len <= 0 ||
                            valid_ipaddr4(location->servers[s].data) < 0) {
@@ -181,10 +184,9 @@ static struct vfsmount *nfs_follow_referral(const struct 
vfsmount *mnt_parent,
                        }
 
                        mountdata.hostname = location->servers[s].data;
-                       addr.sin_addr.s_addr = in_aton(mountdata.hostname);
-                       addr.sin_family = AF_INET;
-                       addr.sin_port = htons(NFS_PORT);
-                       mountdata.addr = &addr;
+                       addr.sin_addr.s_addr = in_aton(mountdata.hostname),
+                       mountdata.addr = (struct sockaddr *)&addr;
+                       mountdata.addrlen = sizeof(addr);
 
                        snprintf(page, PAGE_SIZE, "%s:%s",
                                        mountdata.hostname,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to