]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Add patch for #1029
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 19 May 2009 17:08:10 +0000 (17:08 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 19 May 2009 17:08:10 +0000 (17:08 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8842 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/patches/3.0.1-ipv6-resolution-order.patch [new file with mode: 0644]

diff --git a/bacula/patches/3.0.1-ipv6-resolution-order.patch b/bacula/patches/3.0.1-ipv6-resolution-order.patch
new file mode 100644 (file)
index 0000000..32d6bc1
--- /dev/null
@@ -0,0 +1,41 @@
+
+ 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;