]> git.sur5r.net Git - bacula/bacula/commitdiff
Add extra test for unsupported Protocol Families.
authorMarco van Wieringen <mvw@planets.elm.net>
Wed, 27 Jun 2012 13:32:38 +0000 (15:32 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:51 +0000 (14:50 +0200)
With getaddrinfo we could get back theorethically
an protocol family that we don't support on the
local client. Now we set our hints better we are
probably safe but lets put in some extra safeguards.

bacula/src/lib/bsock.c

index 7ae4e45265a7af75ca5caf62a16f4e1997546c20..4df45e593401fc33d75d59f857cdfdd9292367d5 100644 (file)
@@ -239,10 +239,18 @@ bool BSOCK::open(JCR *jcr, const char *name, char *host, char *service,
          berrno be;
          save_errno = errno;
          switch (errno) {
+#ifdef EPFNOSUPPORT
+         case EPFNOSUPPORT:
+            /*
+             * The name lookup of the host returned an address in a protocol family
+             * we don't support. Suppress the error and try the next address.
+             */
+            break;
+#endif
 #ifdef EAFNOSUPPORT
          case EAFNOSUPPORT:
             /*
-             * The name lookup of the host returned an address in a protocol family
+             * The name lookup of the host returned an address in a address family
              * we don't support. Suppress the error and try the next address.
              */
             break;