]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mount.nfs: restore admin-specified clientaddr option
authorChuck Lever <chuck.lever@oracle.com>
Tue, 4 Sep 2007 20:13:50 +0000 (16:13 -0400)
committerNeil Brown <neilb@suse.de>
Wed, 5 Sep 2007 03:56:26 +0000 (04:56 +0100)
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>
utils/mount/stropts.c

index 12f64230abbe3c1905206db2f7627c44bf15dcf5..236a3b455f078aad944b72ac666fabb6bd4066ad 100644 (file)
@@ -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)