From: Chuck Lever Date: Thu, 3 Mar 2011 22:26:33 +0000 (-0500) Subject: mount: Recognize zero as a valid value for the port= option X-Git-Tag: nfs-utils-1-2-4-rc6~4 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=3ef3dc8f1e87ba7a6eaa3c2a6965aff6c80ba414;p=nfs-utils.git 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 Signed-off-by: Steve Dickson --- 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; }