From: R.E. Wolff Date: Sun, 28 Dec 2014 16:39:16 +0000 (+0100) Subject: removed warning about IPV6 socket when IPV6 is not available at runtime X-Git-Tag: v0.87~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac84e1db5aeb5f0d63a8302a8a1500ba2638eeee;p=thirdparty%2Fmtr.git removed warning about IPV6 socket when IPV6 is not available at runtime --- diff --git a/dns.c b/dns.c index 32b83c2..36f0c12 100644 --- a/dns.c +++ b/dns.c @@ -527,14 +527,9 @@ void dns_open(void) } #ifdef ENABLE_IPV6 resfd6 = socket(AF_INET6, SOCK_DGRAM, 0); - if (resfd6 == -1) { - // consider making removing this warning. For now leave it in to see - // new code activated. -- REW - fprintf(stderr, - "Unable to allocate IPv6 socket for nameserver communication: %s\n", - strerror(errno)); - // exit(-1); - } + // If this fails, e.g. because the user has runtime-disabled IPV6, + // the error can be ignored: the resfd6 is only used if it is + // not the error return code. -- REW #endif option = 1; if (setsockopt(resfd,SOL_SOCKET,SO_BROADCAST,(char *)&option,sizeof(option))) {