]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_setup: disallow Windows IPv6 builds missing getaddrinfo
authorJay Satiro <raysatiro@yahoo.com>
Sat, 28 Oct 2023 04:23:40 +0000 (00:23 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 29 Oct 2023 07:41:33 +0000 (03:41 -0400)
- On Windows if IPv6 is enabled but getaddrinfo is missing then #error
  the build.

curl can be built with IPv6 support (ENABLE_IPV6) but without the
ability to resolve hosts to IPv6 addresses (HAVE_GETADDRINFO). On
Windows this is highly unlikely and should be considered a bad build
configuration.

Such a bad configuration has already given us a bug that was hard to
diagnose. See #12134 and #12136 for discussion.

Ref: https://github.com/curl/curl/issues/12134
Ref: https://github.com/curl/curl/pull/12136

Closes https://github.com/curl/curl/pull/12221

lib/curl_setup.h

index 4ee0aa0a3eaa37420ddcf357a794f5de68eb1d6b..fc462280f5ae517191d60e53f73a557c9b1ed1ea 100644 (file)
 
 #if defined(ENABLE_IPV6) && defined(HAVE_GETADDRINFO)
 #  define CURLRES_IPV6
+#elif defined(ENABLE_IPV6) && (defined(WIN32) || defined(__CYGWIN__))
+/* assume on Windows that IPv6 without getaddrinfo is a broken build */
+#  error "Unexpected build: IPv6 is enabled but getaddrinfo was not found."
 #else
 #  define CURLRES_IPV4
 #endif