The patch below changes autofs to prefer TCP instead of UDP when requesting a 
list of exports from the NFS server. This behavior bring autofs inline with how 
showmount and kshowmount issue mountd EXPORT requests. It also solves a 
possible problem where the export list could be larger than the size of the UDP 
packet.

diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
index cafc775..0ecf447 100644
--- a/lib/rpc_subs.c
+++ b/lib/rpc_subs.c
@@ -938,16 +938,16 @@ exports rpc_get_exports(const char *host, long seconds, 
long micros, unsigned in
        parms.pm_vers = info.version;
        parms.pm_port = 0;
 
-       /* Try UDP first */
-       info.proto = getprotobyname("udp");
+       /* Try TCP first */
+       info.proto = getprotobyname("tcp");
        if (!info.proto)
-               goto try_tcp;
+               goto try_udp;
 
        parms.pm_prot = info.proto->p_proto;
 
        info.port = rpc_portmap_getport(&info, &parms);
        if (!info.port)
-               goto try_tcp;
+               goto try_udp;
 
        memset(&exportlist, '\0', sizeof(exportlist));
 
@@ -955,8 +955,8 @@ exports rpc_get_exports(const char *host, long seconds, 
long micros, unsigned in
        if (status)
                return exportlist;
 
-try_tcp:
-       info.proto = getprotobyname("tcp");
+try_udp:
+       info.proto = getprotobyname("udp");
        if (!info.proto)
                return NULL;

--
Scott Russell <scott.russ...@netapp.com>


_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to