Skip to contentSkip to conversation

NFS: Support non-IPv4 addresses in nfs_parsed_mount_data

PATCH In review Chuck Lever 1 participant 1 message Nov 13, 2007

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 22/25 NFS: Support non-IPv4 addresses in nfs_parsed_mount_data

Replace the nfs_server and mount_server address fields in the nfs_parsed_mount_data structure with a "struct sockaddr_storage" and a length, instead of a "struct sockaddr_in".

Cc Aurelien Charbon <[email protected]>

---

 fs/nfs/client.c   |   11 +++++-----
 fs/nfs/internal.h |    6 ++++--
 fs/nfs/super.c    |   56 +++++++++++++++++++++++++++++++++--------------------
 3 files changed, 44 insertions(+), 29 deletions(-)
fs/nfs/client.c +5 -6
index 37b63a6..3ee0f0d 100644
@@ -573,6 +573,7 @@ error:
 static int nfs_init_server(struct nfs_server *server,
 			   const struct nfs_parsed_mount_data *data)
 {
+	struct sockaddr *sap = (struct sockaddr *)&data->nfs_server.address;
 	struct nfs_client *clp;
 	unsigned int nfsvers = 2;
 	int error;
@@ -585,10 +586,8 @@ static int nfs_init_server(struct nfs_server *server,
 #endif
 
 	/* Allocate or find a client reference we can use */
-	clp = nfs_get_client(data->nfs_server.hostname,
-				(struct sockaddr *)&data->nfs_server.address,
-				sizeof(data->nfs_server.address),
-				nfsvers);
+	clp = nfs_get_client(data->nfs_server.hostname, sap,
+			     data->nfs_server.addrlen, nfsvers);
 	if (IS_ERR(clp)) {
 		dprintk("<-- nfs_init_server() = error %ld\n", PTR_ERR(clp));
 		return PTR_ERR(clp);
@@ -985,6 +984,7 @@ static int nfs4_init_server(struct nfs_server *server,
 struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data,
 				      struct nfs_fh *mntfh)
 {
+	struct sockaddr *sap = (struct sockaddr *)&data->nfs_server.address;
 	struct nfs_fattr fattr;
 	struct nfs_server *server;
 	int error;
@@ -998,8 +998,7 @@ 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,
-			(struct sockaddr *)&data->nfs_server.address,
-			sizeof(data->nfs_server.address),
+			sap, data->nfs_server.addrlen,
 			data->client_address,
 			data->auth_flavors[0],
 			data->nfs_server.protocol,
fs/nfs/internal.h +4 -2
index 40f2619..f8ccba9 100644
@@ -44,7 +44,8 @@ struct nfs_parsed_mount_data {
 	char			*client_address;
 
 	struct {
-		struct sockaddr_in	address;
+		struct sockaddr_storage	address;
+		size_t			addrlen;
 		char			*hostname;
 		unsigned int		version;
 		unsigned short		port;
@@ -52,7 +53,8 @@ struct nfs_parsed_mount_data {
 	} mount_server;
 
 	struct {
-		struct sockaddr_in	address;
+		struct sockaddr_storage	address;
+		size_t			addrlen;
 		char			*hostname;
 		char			*export_path;
 		int			protocol;
fs/nfs/super.c +35 -21

129 lines not on this page · raw message

-------------------------------------------------------------------------
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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs