Use getifaddrs to detect our interfaces if possible The old scheme involved connected UDP sockets and getsockname(), and is generally best avoied.