]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Fix #1029 about resolution address order. Thanks to David.
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 19 May 2009 17:11:40 +0000 (17:11 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 19 May 2009 17:11:40 +0000 (17:11 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8843 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/bnet.c
bacula/technotes

index 9cc236998c382e0d1fd2c1fb8c8384b4e7215a10..2e247eef23c48e0bc297161563e7472f4c4950a4 100644 (file)
@@ -495,13 +495,16 @@ dlist *bnet_host2ipaddrs(const char *host, int family, const char **errstr)
             return 0;
          }
       } else {
-         errmsg = resolv_host(AF_INET, host, addr_list);
 #ifdef HAVE_IPV6
-         if (errmsg) {
-            errmsg = resolv_host(AF_INET6, host, addr_list);
-         }
+         /* We try to resolv host for ipv6 and ipv4, the connection procedure
+          * will try to reach the host for each protocols. We report only "Host
+          * not found" ipv4 message (no need to have ipv6 and ipv4 messages).
+          */
+         resolv_host(AF_INET6, host, addr_list);
 #endif
-         if (errmsg) {
+         errmsg = resolv_host(AF_INET, host, addr_list);
+
+         if (addr_list->size() == 0) {
             *errstr = errmsg;
             free_addresses(addr_list);
             return 0;
index 9d40a64e8bec38419d6ea47fdac3bd6729c965ce..631cca3c7ae184c941712534d4bb33b84dd1154f 100644 (file)
@@ -3,6 +3,8 @@
 General:
 
 19May09
+ebl  Fix #1029 about IPV6/IPV4 address resolution order with help
+     of David.
 kes  During jcr destruction hold jcr_chaing lock only for minimum
      time necessary.  This should fix the SD deadlock in bug #1287.
 18May09