]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
see changelog
authorneilbrown <neilbrown>
Thu, 20 Dec 2001 03:09:14 +0000 (03:09 +0000)
committerneilbrown <neilbrown>
Thu, 20 Dec 2001 03:09:14 +0000 (03:09 +0000)
ChangeLog
support/export/client.c

index 451a7838d80c7233998b5ce16a57569695f86e27..bdd0917acd0164737ffef2a92f6283568f53cc33 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-12-20  NeilBrown <neilb@cse.unsw.edu.au>
+
+       * support/export/client.c(client_lookup): If a host has multiple
+       IP addresses, then we must always use the result of a
+       gethostbyname, not that of gethostbyaddr for exporting
+       
 2001-12-20  NeilBrown <neilb@cse.unsw.edu.au>
 
        * support/export/client.c (client_lookup): use strcasecmp when
index 03f791721774b5937642cf83d150a8c8442636f4..6d5d3063317502d0a958493795b046df23a4f5ab 100644 (file)
@@ -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;