From: Eric Bollengier Date: Tue, 19 May 2009 17:11:40 +0000 (+0000) Subject: ebl Fix #1029 about resolution address order. Thanks to David. X-Git-Tag: Release-3.0.2~223 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6c42ce79b0d0e759aff17303bf376de65901b3dc;p=bacula%2Fbacula ebl Fix #1029 about resolution address order. Thanks to David. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8843 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/lib/bnet.c b/bacula/src/lib/bnet.c index 9cc236998c..2e247eef23 100644 --- a/bacula/src/lib/bnet.c +++ b/bacula/src/lib/bnet.c @@ -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; diff --git a/bacula/technotes b/bacula/technotes index 9d40a64e8b..631cca3c7a 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -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