nsapi - Fixed missing NSAPI_UNSPEC check in gethostbyname for ip literals

pull/3232/head
Christopher Haster 2016-11-08 18:02:42 -06:00
parent fa887764bf
commit a3ad6181f4
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ nsapi_error_t NetworkStack::gethostbyname(const char *name, SocketAddress *addre
{
// check for simple ip addresses
if (address->set_ip_address(name)) {
if (address->get_ip_version() != version) {
if (version != NSAPI_UNSPEC && address->get_ip_version() != version) {
return NSAPI_ERROR_DNS_FAILURE;
}