diff options
author | James Lentini <jlentini@netapp.com> | 2007-09-24 17:32:49 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:17:04 -0400 |
commit | aad700073557c7932ef9f81c19a5e0647f8a6850 (patch) | |
tree | 16fdf949b3c35468805e04b9b970da116bb9d220 /fs/nfs/super.c | |
parent | efd8340bb19c26a43e77c92fee9283b1f5777204 (diff) |
[NFS] [PATCH] NFS: initialize default port in kernel mount client
If no mount server port number is specified, the previous change to the
kernel mount client inadvertently allows the NFS server's port number to be
the used as the mount server's port number. If the user specifies an NFS
server port (-o port=x), the mount will fail.
The fix below sets the mount server's port to 0 if no mount server
port is specified by the user.
Signed-off-by: James Lentini <jlentini@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 5085f53be2fe..094d2f832c3c 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1027,8 +1027,10 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, | |||
1027 | sin = args->mount_server.address; | 1027 | sin = args->mount_server.address; |
1028 | else | 1028 | else |
1029 | sin = args->nfs_server.address; | 1029 | sin = args->nfs_server.address; |
1030 | if (args->mount_server.port != 0) | 1030 | /* |
1031 | sin.sin_port = htons(args->mount_server.port); | 1031 | * autobind will be used if mount_server.port == 0 |
1032 | */ | ||
1033 | sin.sin_port = htons(args->mount_server.port); | ||
1032 | 1034 | ||
1033 | /* | 1035 | /* |
1034 | * Now ask the mount server to map our export path | 1036 | * Now ask the mount server to map our export path |