Skip to content
Commit 23035ca6 authored by Pavel Pisa's avatar Pavel Pisa Committed by Gregory Nutt
Browse files

[PATCH] gethostbyname(): correct returned address format when DNS is used. ...


[PATCH] gethostbyname(): correct returned address format when DNS is used.  The hostent.h_addr_list should point to raw in_addr or in6_addr as defined in the standard. Original implementation used that
for numeric addresses but for DNS lookup returned pointer to whole sockaddr_in or sockaddr_in6.

getaddrinfo() should be preferred in a long term perspective. Return of complete addresses from the lookup would be better in such case but it requires significant changes anyway - multiple addresses support and most probably dynamic memory allocation which is bad for many RT applications. So gethostbyname() is sufficient for most applications now.

Signed-off-by: default avatarPavel Pisa <ppisa@pikron.com>
parent 0b2fbd7a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment