]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/export/client.c
make "exportfs -au" do no DNS lookup
[nfs-utils.git] / support / export / client.c
index 076b0c069dd1ff2991d374ee8c498087601321e8..da3a976bf41bf7657c548faf31ee77f5350dabb2 100644 (file)
@@ -32,8 +32,12 @@ static int   client_checkaddr(nfs_client *clp, struct in_addr addr);
 nfs_client     *clientlist[MCL_MAXTYPES] = { NULL, };
 
 
+/* if canonical is set, then we *know* this is already a canonical name
+ * so hostname lookup is avoided.
+ * This is used when reading /proc/fs/nfs/exports
+ */
 nfs_client *
-client_lookup(char *hname)
+client_lookup(char *hname, int canonical)
 {
        nfs_client      *clp = NULL;
        int             htype;
@@ -41,7 +45,7 @@ client_lookup(char *hname)
 
        htype = client_gettype(hname);
 
-       if (htype == MCL_FQDN) {
+       if (htype == MCL_FQDN && !canonical) {
                struct hostent *hp2;
                hp = gethostbyname(hname);
                if (hp == NULL || hp->h_addrtype != AF_INET) {