Blame SOURCES/autofs-5.1.7-make-NFS-version-check-flags-consistent.patch

91594d
autofs-5.1.7 - make NFS version check flags consistent
91594d
91594d
From: Ian Kent <raven@themaw.net>
91594d
91594d
Several of the NFS connection macros have the same value so that they
91594d
can be used as internal code documentation of what is being done.
91594d
91594d
Adjust the protocol macro naming to be consistent in a few places.
91594d
91594d
Also make sure the correct flags are set for the function they indicate.
91594d
91594d
Signed-off-by: Ian Kent <raven@themaw.net>
91594d
---
91594d
 CHANGELOG           |    1 +
91594d
 modules/mount_nfs.c |   16 +++++++++-------
91594d
 2 files changed, 10 insertions(+), 7 deletions(-)
91594d
91594d
--- autofs-5.1.7.orig/CHANGELOG
91594d
+++ autofs-5.1.7/CHANGELOG
91594d
@@ -96,6 +96,7 @@
91594d
 - fix sysconf(3) return handling.
91594d
 - remove nonstrict parameter from tree_mapent_umount_offsets().
91594d
 - fix handling of incorrect return from umount_ent().
91594d
+- make NFS version check flags consistent.
91594d
 
91594d
 25/01/2021 autofs-5.1.7
91594d
 - make bind mounts propagation slave by default.
91594d
--- autofs-5.1.7.orig/modules/mount_nfs.c
91594d
+++ autofs-5.1.7/modules/mount_nfs.c
91594d
@@ -178,18 +178,20 @@ int mount_mount(struct autofs_point *ap,
91594d
 						port = 0;
91594d
 				} else if (_strncmp("proto=udp", cp, o_len) == 0 ||
91594d
 					   _strncmp("udp", cp, o_len) == 0) {
91594d
-					vers &= ~TCP_SUPPORTED;
91594d
+					vers &= ~TCP_REQUESTED;
91594d
+					vers |= UDP_REQUESTED;
91594d
 				} else if (_strncmp("proto=udp6", cp, o_len) == 0 ||
91594d
 					   _strncmp("udp6", cp, o_len) == 0) {
91594d
-					vers &= ~TCP_SUPPORTED;
91594d
-					vers |= UDP6_REQUESTED;
91594d
+					vers &= ~(TCP_REQUESTED|TCP6_REQUESTED);
91594d
+					vers |= (UDP_REQUESTED|UDP6_REQUESTED);
91594d
 				} else if (_strncmp("proto=tcp", cp, o_len) == 0 ||
91594d
 					   _strncmp("tcp", cp, o_len) == 0) {
91594d
-					vers &= ~UDP_SUPPORTED;
91594d
+					vers &= ~UDP_REQUESTED;
91594d
+					vers |= TCP_REQUESTED;
91594d
 				} else if (_strncmp("proto=tcp6", cp, o_len) == 0 ||
91594d
 					   _strncmp("tcp6", cp, o_len) == 0) {
91594d
-					vers &= ~UDP_SUPPORTED;
91594d
-					vers |= TCP6_REQUESTED;
91594d
+					vers &= ~(UDP_REQUESTED|UDP6_REQUESTED);
91594d
+					vers |= TCP_REQUESTED|TCP6_REQUESTED;
91594d
 				}
91594d
 				/* Check for options that also make sense
91594d
 				   with bind mounts */
91594d
@@ -246,7 +248,7 @@ int mount_mount(struct autofs_point *ap,
91594d
 	    mount_default_proto == 4 &&
91594d
 	    (vers & NFS_VERS_MASK) != 0 &&
91594d
 	    (vers & NFS4_VERS_MASK) != 0 &&
91594d
-	    !(vers & UDP6_REQUESTED)) {
91594d
+	    !(vers & (UDP_REQUESTED|UDP6_REQUESTED))) {
91594d
 		unsigned int v4_probe_ok = 0;
91594d
 		struct host *tmp = new_host(hosts->name, 0,
91594d
 					    hosts->addr, hosts->addr_len,