summaryrefslogtreecommitdiffstats
path: root/support/export/client.c
diff options
context:
space:
mode:
authorneilbrown <neilbrown>2001-09-20 00:37:14 +0000
committerneilbrown <neilbrown>2001-09-20 00:37:14 +0000
commit37e49789ab1cd849def25ba4c4d97ccdb11d1e61 (patch)
tree02cc907f825027f604aa27a8e59a8f7e0100b866 /support/export/client.c
parent4d961554071d2308017062c8bc39f37f5de55b5f (diff)
downloadnfs-utils-37e49789ab1cd849def25ba4c4d97ccdb11d1e61.tar.gz
nfs-utils-37e49789ab1cd849def25ba4c4d97ccdb11d1e61.tar.xz
nfs-utils-37e49789ab1cd849def25ba4c4d97ccdb11d1e61.zip
make "exportfs -au" do no DNS lookup
Diffstat (limited to 'support/export/client.c')
-rw-r--r--support/export/client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/support/export/client.c b/support/export/client.c
index 076b0c0..da3a976 100644
--- a/support/export/client.c
+++ b/support/export/client.c
@@ -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) {