mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #3166 from kjbracey-arm/ipv6_dns_server
nsapi_dns: Provide 2 IPv6-hosted default serverspull/3182/head
commit
35dbb3f256
|
@ -31,11 +31,13 @@
|
||||||
#define DNS_SERVERS_SIZE 5
|
#define DNS_SERVERS_SIZE 5
|
||||||
|
|
||||||
nsapi_addr_t dns_servers[DNS_SERVERS_SIZE] = {
|
nsapi_addr_t dns_servers[DNS_SERVERS_SIZE] = {
|
||||||
{NSAPI_IPv4, {8, 8, 8, 8}},
|
{NSAPI_IPv4, {8, 8, 8, 8}}, // Google
|
||||||
{NSAPI_IPv4, {209, 244, 0, 3}},
|
{NSAPI_IPv4, {209, 244, 0, 3}}, // Level 3
|
||||||
{NSAPI_IPv4, {84, 200, 69, 80}},
|
{NSAPI_IPv4, {84, 200, 69, 80}}, // DNS.WATCH
|
||||||
{NSAPI_IPv4, {8, 26, 56, 26}},
|
{NSAPI_IPv6, {0x20,0x01, 0x48,0x60, 0x48,0x60, 0,0, // Google
|
||||||
{NSAPI_IPv4, {208, 67, 222, 222}},
|
0,0, 0,0, 0,0, 0x88,0x88}},
|
||||||
|
{NSAPI_IPv6, {0x20,0x01, 0x16,0x08, 0,0x10, 0,0x25, // DNS.WATCH
|
||||||
|
0,0, 0,0, 0x1c,0x04, 0xb1,0x2f}},
|
||||||
};
|
};
|
||||||
|
|
||||||
// DNS server configuration
|
// DNS server configuration
|
||||||
|
@ -226,11 +228,9 @@ static int nsapi_dns_query_multiple(NetworkStack *stack, const char *host,
|
||||||
dns_append_question(&question, host, version);
|
dns_append_question(&question, host, version);
|
||||||
|
|
||||||
err = socket.sendto(SocketAddress(dns_servers[i], 53), packet, DNS_BUFFER_SIZE);
|
err = socket.sendto(SocketAddress(dns_servers[i], 53), packet, DNS_BUFFER_SIZE);
|
||||||
if (err == NSAPI_ERROR_WOULD_BLOCK) {
|
// send may fail for various reasons, including wrong address type - move on
|
||||||
|
if (err < 0) {
|
||||||
continue;
|
continue;
|
||||||
} else if (err < 0) {
|
|
||||||
result = err;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// recv the response
|
// recv the response
|
||||||
|
|
Loading…
Reference in New Issue