Blame SOURCES/autofs-5.0.7-only-probe-specific-nfs-version-when-requested.patch

ab3a3d
autofs-5.0.7 - only probe specific nfs version when requested
ab3a3d
ab3a3d
From: Ian Kent <raven@themaw.net>
ab3a3d
ab3a3d
If a specific NFS version is given as an option the set the probe flags
ab3a3d
to probe only that version.
ab3a3d
---
ab3a3d
 CHANGELOG           |    1 +
ab3a3d
 modules/mount_nfs.c |   10 +++++++++-
ab3a3d
 2 files changed, 10 insertions(+), 1 deletion(-)
ab3a3d
ab3a3d
--- autofs-5.0.7.orig/CHANGELOG
ab3a3d
+++ autofs-5.0.7/CHANGELOG
ab3a3d
@@ -63,6 +63,7 @@
ab3a3d
 - teach dumpmaps to output simple key value pairs.
ab3a3d
 - fix get_nfs_info() probe.
ab3a3d
 - fix portmap lookup.
ab3a3d
+- only probe specific nfs version if requested.
ab3a3d
 
ab3a3d
 25/07/2012 autofs-5.0.7
ab3a3d
 =======================
ab3a3d
--- autofs-5.0.7.orig/modules/mount_nfs.c
ab3a3d
+++ autofs-5.0.7/modules/mount_nfs.c
ab3a3d
@@ -146,7 +146,15 @@ int mount_mount(struct autofs_point *ap,
ab3a3d
 				if (strncmp("vers=4", cp, o_len) == 0 ||
ab3a3d
 				    strncmp("nfsvers=4", cp, o_len) == 0)
ab3a3d
 					vers = NFS4_VERS_MASK | TCP_SUPPORTED;
ab3a3d
-				else if (strstr(cp, "port=") == cp &&
ab3a3d
+				else if (strncmp("vers=3", cp, o_len) == 0 ||
ab3a3d
+					 strncmp("nfsvers=3", cp, o_len) == 0) {
ab3a3d
+					vers &= ~(NFS4_VERS_MASK | NFS_VERS_MASK);
ab3a3d
+					vers |= NFS3_REQUESTED;
ab3a3d
+				} else if (strncmp("vers=2", cp, o_len) == 0 ||
ab3a3d
+					 strncmp("nfsvers=2", cp, o_len) == 0) {
ab3a3d
+					vers &= ~(NFS4_VERS_MASK | NFS_VERS_MASK);
ab3a3d
+					vers |= NFS2_REQUESTED;
ab3a3d
+				} else if (strstr(cp, "port=") == cp &&
ab3a3d
 					 o_len - 5 < 25) {
ab3a3d
 					char optport[25];
ab3a3d