]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
removed warning about IPV6 socket when IPV6 is not available at runtime
authorR.E. Wolff <R.E.Wolff@BitWizard.nl>
Sun, 28 Dec 2014 16:39:16 +0000 (17:39 +0100)
committerR.E. Wolff <R.E.Wolff@BitWizard.nl>
Sun, 28 Dec 2014 16:39:16 +0000 (17:39 +0100)
dns.c

diff --git a/dns.c b/dns.c
index 32b83c2b3741874769bbf257604c1899f9e71693..36f0c125cb4b3b8341e4c299e08e13c98008bad3 100644 (file)
--- 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))) {