[PATCH 09/14] text-based mount command: Add IPv6 support to set_mandatory_options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
---

 utils/mount/stropts.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index e2e72a7..caa2c25 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -334,14 +334,15 @@ static int nfs_append_sloppy_option(struct mount_options *options)
  */
 static int nfs_validate_options(struct nfsmount_info *mi)
 {
-	struct sockaddr_in saddr;
+	struct sockaddr_storage dummy;
+	struct sockaddr *sap = (struct sockaddr *)&dummy;
+	socklen_t salen = sizeof(dummy);
 
-	if (!fill_ipv4_sockaddr(mi->hostname, &saddr))
+	if (!nfs_name_to_address(mi->hostname, mi->family, sap, &salen))
 		return 0;
 
 	if (strncmp(mi->type, "nfs4", 4) == 0) {
-		if (!nfs_append_clientaddr_option((struct sockaddr *)&saddr,
-						  sizeof(saddr), mi->options))
+		if (!nfs_append_clientaddr_option(sap, salen, mi->options))
 			return 0;
 	} else {
 		if (!nfs_fix_mounthost_option(mi->family, mi->options))
@@ -353,8 +354,7 @@ static int nfs_validate_options(struct nfsmount_info *mi)
 	if (!nfs_append_sloppy_option(mi->options))
 		return 0;
 
-	return nfs_append_addr_option((struct sockaddr *)&saddr,
-					sizeof(saddr), mi->options);
+	return nfs_append_addr_option(sap, salen, mi->options);
 }
 
 /*

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux