From b2fe36fe5b504ae2221a4306f76e663fff38090f Mon Sep 17 00:00:00 2001
From: James R <justsomejames2@gmail.com>
Date: Fri, 3 Sep 2021 16:48:29 -0700
Subject: [PATCH] Add back address resolution test

Mistakenly removed by a1a58143e
---
 src/i_tcp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/i_tcp.c b/src/i_tcp.c
index 9cdcc6ec47..48a65faae3 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;
-- 
GitLab