From: sfan5 Date: Mon, 18 Mar 2019 14:06:27 +0000 (+0100) Subject: httpfetch: Disable IPv6 here too if requested by settings (#8399) X-Git-Tag: 5.1.0~266 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=426bdba7fb90ce97b8bbdf102d770c4e8a27d8c1;p=oweals%2Fminetest.git httpfetch: Disable IPv6 here too if requested by settings (#8399) --- diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index 6b67e0e13..326b5052f 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -253,6 +253,10 @@ HTTPFetchOngoing::HTTPFetchOngoing(const HTTPFetchRequest &request_, curl_easy_setopt(curl, CURLOPT_INTERFACE, bind_address.c_str()); } + if (!g_settings->getBool("enable_ipv6")) { + curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + } + #if LIBCURL_VERSION_NUM >= 0x071304 // Restrict protocols so that curl vulnerabilities in // other protocols don't affect us.