Return localhost from NanostackInterface::get_ip_address()

For NetworkStack::gethostbyname() to properly validate the
IP address version, we must return a valid address from
Networkstack::get_ip_address().
pull/3267/head
Seppo Takalo 2016-11-16 19:07:23 +02:00
parent 9f8fe897d8
commit 3d5962db48
1 changed files with 4 additions and 2 deletions

View File

@ -457,8 +457,10 @@ NanostackInterface * NanostackInterface::get_stack()
const char * NanostackInterface::get_ip_address()
{
// Unsupported
return NULL;
// Must result a valid IPv6 address
// For gethostbyname() to detect IP version.
static const char localhost[] = "::";
return localhost;
}
nsapi_error_t NanostackInterface::socket_open(void **handle, nsapi_protocol_t protocol)