From 46a5ce4325fbe23234a8167bd16bc4ef6bf7ceee Mon Sep 17 00:00:00 2001
From: James R <justsomejames2@gmail.com>
Date: Wed, 1 Sep 2021 18:41:41 -0700
Subject: [PATCH] Only restrict master server connection to IPv4 if -noipv6

---
 src/http-mserv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/http-mserv.c b/src/http-mserv.c
index f9134ba500..a0912a81ee 100644
--- a/src/http-mserv.c
+++ b/src/http-mserv.c
@@ -196,7 +196,9 @@ HMS_connect (const char *format, ...)
 
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
-	curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+
+	if (M_CheckParm("-noipv6"))
+		curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
 
 	curl_easy_setopt(curl, CURLOPT_TIMEOUT, cv_masterserver_timeout.value);
 	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
-- 
GitLab