Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions features/netsocket/NetworkStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ int NetworkStack::gethostbyname(const char *name, SocketAddress *address, nsapi_
return 0;
}

// if the version is unspecified, try to guess the version from the
// ip address of the underlying stack
if (version == NSAPI_UNSPEC) {
SocketAddress testaddress;
if (testaddress.set_ip_address(this->get_ip_address())) {
version = testaddress.get_ip_version();
}
}

return nsapi_dns_query(this, name, address, version);
}

Expand Down