Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ignore rogue DNS servers reported by windows

  • Loading branch information...
commit d6cf655afda09d6bf3c260cce91275f69b9bc512 1 parent 51e9dbc
@piscisaureus piscisaureus authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/ares/ares_init.c
View
13 src/ares/ares_init.c
@@ -696,17 +696,22 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
struct sockaddr_in6 *pIPv6Addr = ( struct sockaddr_in6 * ) pGenericAddr;
ares_inet_ntop( AF_INET6, &pIPv6Addr->sin6_addr, ret, ipv6_size - 1 ); /* -1 for comma */
+ stringlen = strlen( ret );
+
+ /* Windows apparently always reports some IPv6 DNS servers that
+ prefixed with fec0:0:0:ffff. These ususally do not point to
+ working DNS servers, we we ignore them. */
+ if (strncmp(ret, "fec0:0:0:ffff:", 14) == 0) {
+ continue;
+ }
+
/* Append a comma to the end, THEN NULL. Should be OK because we
already tested the size at the top of the if statement. */
- stringlen = strlen( ret );
ret[ stringlen ] = ',';
ret[ stringlen + 1 ] = '\0';
ret += stringlen + 1;
left -= ret - ret_buf;
++count;
-
- /* NB on Windows this also returns stuff in the fec0::/10 range,
- seems to be hard-coded somehow. Do we need to ignore them? */
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.