From: Haw Loeung Date: Fri, 15 Aug 2014 02:25:20 +0000 (+1000) Subject: Fixed to consider IPv6 nameservers and to also handle case where only IPv6 nameserver... X-Git-Tag: v0.86~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f45352dcb7e92471edd0e69de950c30e78d00424;p=thirdparty%2Fmtr.git Fixed to consider IPv6 nameservers and to also handle case where only IPv6 nameservers are specified. --- diff --git a/dns.c b/dns.c index 32b83c2..21ab60a 100644 --- 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); }