diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2011-03-03 17:26:33 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2011-03-03 17:26:33 -0500 |
commit | 3ef3dc8f1e87ba7a6eaa3c2a6965aff6c80ba414 (patch) | |
tree | fe2f2923c57d079e2b8318d91c65bf8843ee07bc /utils | |
parent | b3a4dbfb61dad59829f5191d727267b2ea45937a (diff) | |
download | nfs-utils-3ef3dc8f1e87ba7a6eaa3c2a6965aff6c80ba414.tar.gz nfs-utils-3ef3dc8f1e87ba7a6eaa3c2a6965aff6c80ba414.tar.xz nfs-utils-3ef3dc8f1e87ba7a6eaa3c2a6965aff6c80ba414.zip |
mount: Recognize zero as a valid value for the port= option
While zero is not a valid IP port number, zero does represent a valid
value for "port=". It means "query rpcbind to discover the actual
non-zero port number to use". So the parsing functions that handle
"port=" should not flag zero as an invalid value.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/mount/network.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c index 21a7a2c..9b6504d 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -1346,7 +1346,7 @@ nfs_nfs_port(struct mount_options *options, unsigned long *port) case PO_NOT_FOUND: break; case PO_FOUND: - if (tmp >= 1 && tmp <= 65535) { + if (tmp >= 0 && tmp <= 65535) { *port = tmp; return 1; } @@ -1538,7 +1538,7 @@ nfs_mount_port(struct mount_options *options, unsigned long *port) case PO_NOT_FOUND: break; case PO_FOUND: - if (tmp >= 1 && tmp <= 65535) { + if (tmp >= 0 && tmp <= 65535) { *port = tmp; return 1; } |