X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fmountd.c;h=e151fa2246eee9c390a0aee88996be0a3b85b808;hp=c1d18d4cebc9b37b1f227d7de33fe1aaf4ccfaaf;hb=9e1aa7b9a04776bd43eb75bef50a53f41e17b813;hpb=93608a52655abf5ac23404c4b5cc05fe575a9c04 diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index c1d18d4..e151fa2 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -225,14 +225,11 @@ mount_umnt_1_svc(struct svc_req *rqstp, dirpath *argp, void *resp) if (!(exp = auth_authenticate("unmount", sin, p))) { return 1; } - if (new_cache) { - if (strcmp(inet_ntoa(exp->m_client->m_addrlist[0]), exp->m_client->m_hostname)) - mountlist_del(inet_ntoa(exp->m_client->m_addrlist[0]), exp->m_client->m_hostname); - mountlist_del(exp->m_client->m_hostname, p); - } else { - mountlist_del(exp->m_client->m_hostname, p); + + if (!new_cache) export_reset (exp); - } + + mountlist_del(inet_ntoa(sin->sin_addr), p); return 1; } @@ -421,8 +418,10 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, mountstat3 *error, int v3) fh = cache_get_filehandle(exp, v3?64:32, p); if (fh == NULL) *error = NFSERR_ACCES; - else + else { *error = NFS_OK; + mountlist_add(inet_ntoa(sin->sin_addr), p); + } return fh; } else { struct nfs_fh_len *fh; @@ -443,7 +442,7 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, mountstat3 *error, int v3) stb.st_dev, stb.st_ino); } if (fh != NULL) { - mountlist_add(exp->m_client->m_hostname, p); + mountlist_add(inet_ntoa(sin->sin_addr), p); *error = NFS_OK; export_reset (exp); return fh; @@ -558,7 +557,7 @@ main(int argc, char **argv) /* Parse the command line options and arguments. */ opterr = 0; - while ((c = getopt_long(argc, argv, "o:n:Fd:f:p:P:hH:N:V:vs:t:", longopts, NULL)) != EOF) + while ((c = getopt_long(argc, argv, "o:nFd:f:p:P:hH:N:V:vs:t:", longopts, NULL)) != EOF) switch (c) { case 'o': descriptors = atoi(optarg);