58 lines
1.9 KiB
Diff
58 lines
1.9 KiB
Diff
|
From eae1b58c5a9f074f79a0edfaeb1cf7a4e77a34cb Mon Sep 17 00:00:00 2001
|
||
|
From: Michal Sekletar <sekletar.m@gmail.com>
|
||
|
Date: Tue, 24 Sep 2013 12:56:11 +0200
|
||
|
Subject: [PATCH] dns: iterate over all configured nameservers
|
||
|
|
||
|
Previously if there were three nameservers configured and third one was
|
||
|
reachable via IPv6 we didn't sent query to it, since NSCOUNT6 was equal to
|
||
|
one. Clearly it was the original intention to sent query to all IPv6
|
||
|
nameservers.
|
||
|
|
||
|
Reported-by: Benedikt Gollatz <benedikt@gollatz.net>
|
||
|
---
|
||
|
dns.c | 8 ++++----
|
||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/dns.c b/dns.c
|
||
|
index 221665d..e89fd4b 100644
|
||
|
--- a/dns.c
|
||
|
+++ b/dns.c
|
||
|
@@ -938,7 +938,7 @@ void dorequest(char *s,int type,word id)
|
||
|
hp->id = id; /* htons() deliberately left out (redundant) */
|
||
|
#ifdef ENABLE_IPV6
|
||
|
if (resfd6 > 0) {
|
||
|
- for (i = 0;i < NSCOUNT6;i++) {
|
||
|
+ for (i = 0;i < myres.nscount;i++) {
|
||
|
if (!NSSOCKADDR6(i))
|
||
|
continue;
|
||
|
if (NSSOCKADDR6(i)->sin6_family == AF_INET6)
|
||
|
@@ -1342,7 +1342,7 @@ void dns_ack6(void)
|
||
|
/* Check to see if this server is actually one we sent to */
|
||
|
if ( addrcmp( (void *) &(from6->sin6_addr), (void *) &localhost6,
|
||
|
(int) AF_INET6 ) == 0 ) {
|
||
|
- for (i = 0;i < NSCOUNT6;i++) {
|
||
|
+ for (i = 0;i < myres.nscount;i++) {
|
||
|
if (!NSSOCKADDR6(i))
|
||
|
continue;
|
||
|
|
||
|
@@ -1353,14 +1353,14 @@ void dns_ack6(void)
|
||
|
break;
|
||
|
}
|
||
|
} else
|
||
|
- for (i = 0;i < NSCOUNT6;i++) {
|
||
|
+ for (i = 0;i < myres.nscount;i++) {
|
||
|
if (!NSSOCKADDR6(i))
|
||
|
continue;
|
||
|
if ( addrcmp( (void *) &(NSSOCKADDR6(i)->sin6_addr),
|
||
|
(void *) &(from6->sin6_addr), AF_INET6 ) == 0 )
|
||
|
break;
|
||
|
}
|
||
|
- if (i == NSCOUNT6) {
|
||
|
+ if (i == myres.nscount) {
|
||
|
snprintf(tempstring, sizeof(tempstring),
|
||
|
"Resolver error: Received reply from unknown source: %s",
|
||
|
inet_ntop( AF_INET6, &(from6->sin6_addr), addrstr,
|
||
|
--
|
||
|
1.8.3.1
|
||
|
|