diff --git a/src/i_tcp.c b/src/i_tcp.c index 9cdcc6ec4..48a65faae 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -1204,7 +1204,11 @@ static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port) // test ip address of server for (i = 0; i < mysocketses; ++i) { - if (runp->ai_addr->sa_family == myfamily[i]) + /* sendto tests that there is a network to this + address */ + if (runp->ai_addr->sa_family == myfamily[i] && + sendto(mysockets[i], NULL, 0, 0, + runp->ai_addr, runp->ai_addrlen) == 0) { memcpy(&clientaddress[newnode], runp->ai_addr, runp->ai_addrlen); break;