From 1af9e4a2f9e36f26eb973883983a155e381371ea Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Wed, 27 Jun 2012 15:32:38 +0200 Subject: [PATCH] Add extra test for unsupported Protocol Families. 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bacula/src/lib/bsock.c b/bacula/src/lib/bsock.c index 7ae4e45265..4df45e5934 100644 --- a/bacula/src/lib/bsock.c +++ b/bacula/src/lib/bsock.c @@ -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; -- 2.39.5