Skip to contentSkip to conversation

mount.nfs: restore admin-specified clientaddr option

PATCH Applied Chuck Lever 1 participant 1 message Sep 4, 2007

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

PATCH 1/2 mount.nfs: restore admin-specified clientaddr option

Revert an earlier change to make specifying the clientaddr= option illegal.

Jeff Layton pointed out that admins may want to specify the clientaddr= option to advertise a different callback address when accessing an NFSv4 server through a NAT router.

---

 utils/mount/stropts.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
utils/mount/stropts.c +4 -7
index 12f6423..236a3b4 100644
@@ -201,7 +201,9 @@ static int append_addr_opt(struct sockaddr_in *saddr, char **extra_opts)
 }
 
 /*
- * Append the 'clientaddr=' option to the options string.
+ * Called if no 'clientaddr=' option was specified in the options string
+ * to discover our address and append an appropriate 'clientaddr=' option
+ * to the options string.
  *
  * Returns 1 if 'clientaddr=' option created successfully;
  * otherwise zero.
@@ -319,15 +321,10 @@ int nfs4mount_s(const char *spec, const char *node, int flags,
 		return EX_FAIL;
 	}
 
-	if (ca_opt) {
-		nfs_error(_("%s: Illegal option: 'clientaddr='"), progname);
-		return EX_FAIL;
-	}
-
 	if (!append_addr_opt(&saddr, extra_opts))
 		return EX_FAIL;
 
-	if (!append_clientaddr_opt(&saddr, extra_opts))
+	if (!ca_opt && !append_clientaddr_opt(&saddr, extra_opts))
 		return EX_FAIL;
 
 	if (verbose)

-------------------------------------------------------------------------
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