[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: Pavel Pisa <ppisa@pikron.com>
parent
0b2fbd7a
Please register or sign in to comment