diff --git a/libc/netdb/lib_gethostbynamer.c b/libc/netdb/lib_gethostbynamer.c index b6552116516..e95d9a853a3 100644 --- a/libc/netdb/lib_gethostbynamer.c +++ b/libc/netdb/lib_gethostbynamer.c @@ -205,6 +205,10 @@ static int lib_numeric_address(FAR const char *name, FAR struct hostent *host, } strncpy(ptr, name, buflen); + + /* Set the address to h_name */ + + host->h_name = ptr; return 0; } @@ -289,6 +293,10 @@ static int lib_localhost(FAR const char *name, FAR struct hostent *host, } strncpy(dest, name, buflen); + + /* Set the address to h_name */ + + host->h_name = dest; return 0; } @@ -401,6 +409,10 @@ static int lib_find_answer(FAR const char *name, FAR struct hostent *host, } strncpy(ptr, name, buflen); + + /* Set the address to h_name */ + + host->h_name = ptr; return OK; } #endif /* CONFIG_NETDB_DNSCLIENT */ @@ -543,6 +555,10 @@ static int lib_dns_lookup(FAR const char *name, FAR struct hostent *host, } strncpy(ptr, name, buflen); + + /* Set the address to h_name */ + + host->h_name = ptr; return OK; }