summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-09-04 16:13:50 -0400
committerNeil Brown <neilb@suse.de>2007-09-05 04:56:26 +0100
commit84b4008aaa7f85e1f9de265ee5c80a4a48fb31dc (patch)
tree95bb776cae61db1db26cb554c30f9a1b98f6e79c
parent2fa7d272bdbfe3a73d813b843e5d66b1c044459e (diff)
downloadnfs-utils-84b4008aaa7f85e1f9de265ee5c80a4a48fb31dc.tar.gz
nfs-utils-84b4008aaa7f85e1f9de265ee5c80a4a48fb31dc.tar.xz
nfs-utils-84b4008aaa7f85e1f9de265ee5c80a4a48fb31dc.zip
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. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
-rw-r--r--utils/mount/stropts.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 12f6423..236a3b4 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -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)