[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20071113183302.5087.85854.stgit@manray.1015granger.net>
Date: Tue, 13 Nov 2007 13:33:02 -0500
From: Chuck Lever <chuck.lever@...cle.com>
To: nfs@...ts.sourceforge.net
Cc: netdev@...r.kernel.org
Subject: [PATCH 23/25] NFS: Add AF_INET6 support to nfs_try_mount()
Update nfs_try_mount() to support AF_INET6 family addresses.
Signed-off-by: Chuck Lever <chuck.lever@...cle.com>
---
fs/nfs/super.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 3ea4a4f..2abef88 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1048,7 +1048,7 @@ out_unknown:
static int nfs_try_mount(struct nfs_parsed_mount_data *args,
struct nfs_fh *root_fh)
{
- struct sockaddr_in sin;
+ struct sockaddr *sap = (struct sockaddr *)&args->mount_server.address;
int status;
char *hostname;
@@ -1067,24 +1067,25 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
/*
* Construct the mount server's address.
*/
- if (args->mount_server.addrlen != 0)
- memcpy(&sin, &args->mount_server.address, sizeof(sin));
- else
- memcpy(&sin, &args->nfs_server.address, sizeof(sin));
+ if (args->mount_server.addrlen == 0) {
+ memcpy(&args->mount_server.address,
+ &args->nfs_server.address,
+ args->nfs_server.addrlen);
+ args->mount_server.addrlen = args->nfs_server.addrlen;
+ }
/*
* autobind will be used if mount_server.port == 0
*/
- if (nfs_set_address_port((struct sockaddr *)&sin,
- args->mount_server.port))
+ if (nfs_set_address_port(sap, args->mount_server.port))
return -EAFNOSUPPORT;
/*
* Now ask the mount server to map our export path
* to a file handle.
*/
- status = nfs_mount((struct sockaddr *) &sin,
- sizeof(sin),
+ status = nfs_mount(sap,
+ args->mount_server.addrlen,
hostname,
args->nfs_server.export_path,
args->mount_server.version,
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists