<commit_before><commit_msg>ebl  Add patch for #1029<commit_after>
 This patch can be applied to version 3.0.1 and fixes a
 IP address resolution priorities between ipv4 and ipv6.
 This should fix bug #1029

 Apply it to version 3.0.1 with:

 cd <bacula-source>
 patch -p0 <3.0.1-ipv6-resolution-order.patch
 ./configure <your-options>
 make
 ...
 make install


Index: src/lib/bnet.c
===================================================================
--- src/lib/bnet.c	(révision 8841)
+++ src/lib/bnet.c	(copie de travail)
@@ -495,13 +495,16 @@
             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;
{'fraction_non_alphanumeric': 0.15846153846153846, 'fraction_numerical': 0.03538461538461538, 'mean_word_length': 2.3273657289002556, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6338158', 'n_tokens_mistral': 453, 'n_tokens_neox': 424, 'n_words': 126}