[PATCH 3/5] autofs-5.0.8 - get_nfs_info() should query portmapper if port is not given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Scott Mayhew <smayhew@xxxxxxxxxx>

It shouldn't just assume it can use port 2049.

Signed-off-by: Scott Mayhew <smayhew@xxxxxxxxxx>
---
 modules/replicated.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/replicated.c b/modules/replicated.c
index 5fdd9d9..2463235 100644
--- a/modules/replicated.c
+++ b/modules/replicated.c
@@ -444,9 +444,12 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host,
 		      host->name, proto, version);
 
 	rpc_info->proto = proto;
-	if (port < 0)
-		rpc_info->port = NFS_PORT;
-	else if (port > 0)
+	if (port < 0) {
+		if (version & NFS4_REQUESTED)
+			rpc_info->port = NFS_PORT;
+		else
+			port = 0;
+	} else if (port > 0)
 		rpc_info->port = port;
 
 	memset(&parms, 0, sizeof(struct pmap));

--
To unsubscribe from this list: send the line "unsubscribe autofs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux