]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mountd/cache.c
mountd/exportfs: Make m_addrlist field a nfs_sockaddr
[nfs-utils.git] / utils / mountd / cache.c
index 45397db66dcd8c66d36aad9f6608456ab16cf1de..caef5b235c692804af81e2c3a569ef43d5928807 100644 (file)
@@ -614,12 +614,12 @@ static int dump_to_cache(FILE *f, char *domain, char *path, struct exportent *ex
        return qword_eol(f);
 }
 
-static int is_subdirectory(char *subpath, char *path)
+static int is_subdirectory(char *child, char *parent)
 {
-       int l = strlen(path);
+       int l = strlen(parent);
 
-       return strcmp(subpath, path) == 0
-               || (strncmp(subpath, path, l) == 0 && subpath[l] == '/');
+       return strcmp(child, parent) == 0
+               || (strncmp(child, parent, l) == 0 && child[l] == '/');
 }
 
 static int path_matches(nfs_export *exp, char *path)
@@ -863,6 +863,7 @@ int cache_export_ent(char *domain, struct exportent *exp, char *path)
 
 int cache_export(nfs_export *exp, char *path)
 {
+       struct sockaddr_in *sin = get_addrlist_in(exp->m_client, 0);
        int err;
        FILE *f;
 
@@ -871,7 +872,7 @@ int cache_export(nfs_export *exp, char *path)
                return -1;
 
        qword_print(f, "nfsd");
-       qword_print(f, inet_ntoa(exp->m_client->m_addrlist[0]));
+       qword_print(f, inet_ntoa(sin->sin_addr));
        qword_printint(f, time(0)+30*60);
        qword_print(f, exp->m_client->m_hostname);
        err = qword_eol(f);