From 3ef3dc8f1e87ba7a6eaa3c2a6965aff6c80ba414 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Thu, 3 Mar 2011 17:26:33 -0500 Subject: [PATCH] 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 --- utils/mount/network.c | 4 ++-- 1 file 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; } -- 2.39.5