]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mount: Recognize zero as a valid value for the port= option
authorChuck Lever <chuck.lever@oracle.com>
Thu, 3 Mar 2011 22:26:33 +0000 (17:26 -0500)
committerSteve Dickson <steved@redhat.com>
Thu, 3 Mar 2011 22:26:33 +0000 (17:26 -0500)
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>
utils/mount/network.c

index 21a7a2cc11fd8ed2faa5fa064c7a68bf5b5e3026..9b6504d430b1b0be6dd8ad3672d4707690a44742 100644 (file)
@@ -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;
                }