fb20090
commit 5f32083c759b468f5b0cb9302e4fe2848d37cc5b
fb20090
Author: Steve Dickson <steved@redhat.com>
fb20090
Date:   Tue Apr 10 10:25:40 2018 -0400
fb20090
fb20090
    mount.nfs: Fix auto protocol negotiation
fb20090
    
fb20090
    Commit 71b807e1 introduce a regression that
fb20090
    caused v3 not to be tried when v4 was not
fb20090
    supported by the server during auto negation.
fb20090
    
fb20090
    A check of the type in nfs_nfs_version() was
fb20090
    reverted back to only check for the "nfs4"
fb20090
    string not the "nfs" string which fixed the
fb20090
    problem.
fb20090
    
fb20090
    Signed-off-by: Steve Dickson <steved@redhat.com>
fb20090
fb20090
diff --git a/utils/mount/network.c b/utils/mount/network.c
fb20090
index 9a2c878..e490399 100644
fb20090
--- a/utils/mount/network.c
fb20090
+++ b/utils/mount/network.c
fb20090
@@ -1279,8 +1279,8 @@ nfs_nfs_version(char *type, struct mount_options *options, struct nfs_version *v
fb20090
 		}
fb20090
 	}
fb20090
 
fb20090
-	if (!found && strncmp(type, "nfs", 3) == 0)
fb20090
-		version_val = "4";
fb20090
+	if (!found && strcmp(type, "nfs4") == 0)
fb20090
+		version_val = type + 3;
fb20090
 	else if (!found)
fb20090
 		return 1;
fb20090
 	else if (i <= 2 ) {