]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mountd/cache.c
lookup_export: really prefer nonV4ROOT exports.
[nfs-utils.git] / utils / mountd / cache.c
index ac9cdbd2e0ed30fedcd03a368e1f79797cda3f35..b01c0bdb4e944286a03664c33c53bb922999e04a 100644 (file)
@@ -772,10 +772,14 @@ lookup_export(char *dom, char *path, struct addrinfo *ai)
                                found_type = i;
                                continue;
                        }
-
-                       /* Always prefer non-V4ROOT mounts */
-                       if (found->m_export.e_flags & NFSEXP_V4ROOT)
+                       /* Always prefer non-V4ROOT exports */
+                       if (exp->m_export.e_flags & NFSEXP_V4ROOT)
                                continue;
+                       if (found->m_export.e_flags & NFSEXP_V4ROOT) {
+                               found = exp;
+                               found_type = i;
+                               continue;
+                       }
 
                        /* If one is a CROSSMOUNT, then prefer the longest path */
                        if (((found->m_export.e_flags & NFSEXP_CROSSMOUNT) ||