I call getaddrinfo
. It returns a list of matching addresses. One of them belongs to the machine from which the call was made. How do I determine which one it is?
If there is no way to do so, is there anything else I can do to reliably and portably determine the IP address of a particular network interface on the current machine?
If there is no portable way, what is the Linux-specific way?