]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/3.0.1-ipv6-resolution-order.patch
Tweak keep readall error messages
[bacula/bacula] / bacula / patches / 3.0.1-ipv6-resolution-order.patch
1
2  This patch can be applied to version 3.0.1 and fixes a
3  IP address resolution priorities between ipv4 and ipv6.
4  This should fix bug #1029
5
6  Apply it to version 3.0.1 with:
7
8  cd <bacula-source>
9  patch -p0 <3.0.1-ipv6-resolution-order.patch
10  ./configure <your-options>
11  make
12  ...
13  make install
14
15
16 Index: src/lib/bnet.c
17 ===================================================================
18 --- src/lib/bnet.c      (rĂ©vision 8841)
19 +++ src/lib/bnet.c      (copie de travail)
20 @@ -495,13 +495,16 @@
21              return 0;
22           }
23        } else {
24 -         errmsg = resolv_host(AF_INET, host, addr_list);
25  #ifdef HAVE_IPV6
26 -         if (errmsg) {
27 -            errmsg = resolv_host(AF_INET6, host, addr_list);
28 -         }
29 +         /* We try to resolv host for ipv6 and ipv4, the connection procedure
30 +          * will try to reach the host for each protocols. We report only "Host
31 +          * not found" ipv4 message (no need to have ipv6 and ipv4 messages).
32 +          */
33 +         resolv_host(AF_INET6, host, addr_list);
34  #endif
35 -         if (errmsg) {
36 +         errmsg = resolv_host(AF_INET, host, addr_list);
37 +
38 +         if (addr_list->size() == 0) {
39              *errstr = errmsg;
40              free_addresses(addr_list);
41              return 0;