netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 23/25] NFS: Add AF_INET6 support to nfs_try_mount()
@ 2007-11-13 18:33 Chuck Lever
  0 siblings, 0 replies; only message in thread
From: Chuck Lever @ 2007-11-13 18:33 UTC (permalink / raw)
  To: nfs; +Cc: netdev

Update nfs_try_mount() to support AF_INET6 family addresses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.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,


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-13 18:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-13 18:33 [PATCH 23/25] NFS: Add AF_INET6 support to nfs_try_mount() Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).