X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Fexport%2Fclient.c;h=6d5d3063317502d0a958493795b046df23a4f5ab;hb=a1c827e358e11fcf27e223ed45a54f6d328e78bc;hp=da3a976bf41bf7657c548faf31ee77f5350dabb2;hpb=37e49789ab1cd849def25ba4c4d97ccdb11d1e61;p=nfs-utils.git diff --git a/support/export/client.c b/support/export/client.c index da3a976..6d5d306 100644 --- a/support/export/client.c +++ b/support/export/client.c @@ -57,8 +57,17 @@ client_lookup(char *hname, int canonical) hp = gethostbyaddr(hp2->h_addr, hp2->h_length, hp2->h_addrtype); if (hp) { - free(hp2); hp = hostent_dup(hp); + /* but now we might not have all addresses... */ + if (hp2->h_addr_list[1]) { + struct hostent *hp3 = + gethostbyname(hp->h_name); + if (hp3) { + free(hp); + hp = hostent_dup(hp3); + } + } + free(hp2); } else hp = hp2; @@ -70,7 +79,7 @@ client_lookup(char *hname, int canonical) } } else { for (clp = clientlist[htype]; clp; clp = clp->m_next) { - if (strcmp(hname, clp->m_hostname)==0) + if (strcasecmp(hname, clp->m_hostname)==0) break; } }