]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
Fixed to consider IPv6 nameservers and to also handle case where only IPv6 nameserver...
authorHaw Loeung <haw.loeung@canonical.com>
Fri, 15 Aug 2014 02:25:20 +0000 (12:25 +1000)
committerHaw Loeung <haw.loeung@canonical.com>
Fri, 15 Aug 2014 02:25:20 +0000 (12:25 +1000)
dns.c

diff --git a/dns.c b/dns.c
index 32b83c2b3741874769bbf257604c1899f9e71693..21ab60a1c38b22a4162fc484c026a4b5dc8d11a2 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -509,11 +509,16 @@ int dns_waitfd6(void)
 
 void dns_open(void)
 {
-  int option,i;
+  int option,i,nscount;
 
   if (!dns) return;
   MY_RES_INIT();
-  if (!myres.nscount) {
+#ifdef ENABLE_IPV6
+  nscount = myres.nscount + myres._u._ext.nscount6;
+#else
+  nscount = myres.nscount;
+#endif
+  if (!nscount) {
     fprintf(stderr,"No nameservers defined.\n");
     exit(-1);
   }