]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NFSv4: When mounting with a port=0 argument, substitute port=2049
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 15 Sep 2006 20:31:56 +0000 (16:31 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 23 Sep 2006 03:25:04 +0000 (23:25 -0400)
RFC3530 states that the registered port 2049 for the NFS protocol should be
the default configuration in order to allow clients not to use the RPC
binding protocols.
If the mount program sends us a port=0, we therefore substitute port=2049.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/super.c

index 665949d277981eac7d5df2394717b6e0a2fa4e9e..b99113b0f65fa222acfdb29e1e8443755b18add5 100644 (file)
@@ -833,6 +833,9 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
                                __FUNCTION__);
                return -EINVAL;
        }
+       /* RFC3530: The default port for NFS is 2049 */
+       if (addr.sin_port == 0)
+               addr.sin_port = NFS_PORT;
 
        /* Grab the authentication type */
        authflavour = RPC_AUTH_UNIX;