Revert "Revert "socket: use getaddrinfo""