mirror of https://github.com/ARMmbed/mbed-os.git
DNS: Fix return value for successful name resolutions
parent
7e292fb9b7
commit
922e9526bf
|
|
@ -217,7 +217,7 @@ static int nsapi_dns_query_multiple(NetworkStack *stack, const char *host,
|
|||
return NSAPI_ERROR_NO_MEMORY;
|
||||
}
|
||||
|
||||
int result = NSAPI_ERROR_DNS_FAILURE;
|
||||
int result = NSAPI_ERROR_OK;
|
||||
|
||||
// check against each dns server
|
||||
for (unsigned i = 0; i < DNS_SERVERS_SIZE; i++) {
|
||||
|
|
@ -243,9 +243,12 @@ static int nsapi_dns_query_multiple(NetworkStack *stack, const char *host,
|
|||
}
|
||||
|
||||
const uint8_t *response = packet;
|
||||
dns_scan_response(&response, addr, addr_count);
|
||||
if (!dns_scan_response(&response, addr, addr_count)) {
|
||||
result = NSAPI_ERROR_DNS_FAILURE;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// clean up packet
|
||||
free(packet);
|
||||
|
|
|
|||
Loading…
Reference in New Issue