I want to understand in which order are the elements of h_addr_list
sorted when I get the hostent
from gethostbyname
.
Basically, I'm working on a very old function that gets a hostent
struct from gethostbyname
, and returnes h_addr
to the caller. I'm trying to figure out which address will be returned in case of multiple active interfaces.
Google and source-code browsing could not help me here. Is there documentation or some information on the order of h_addr_list
?
P.S. I'm working on code for both Windows and Linux.