Skip to content

Commit

Permalink
[NFS] [PATCH] NFS: initialize default port in kernel mount client
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Lentini authored and Trond Myklebust committed Oct 9, 2007
1 parent efd8340 commit aad7000
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,10 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
sin = args->mount_server.address;
else
sin = args->nfs_server.address;
if (args->mount_server.port != 0)
sin.sin_port = htons(args->mount_server.port);
/*
* autobind will be used if mount_server.port == 0
*/
sin.sin_port = htons(args->mount_server.port);

/*
* Now ask the mount server to map our export path
Expand Down

0 comments on commit aad7000

Please sign in to comment.