]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: fix AF_INET6 use outside of USE_IPV6
authorHarry Sintonen <sintonen@iki.fi>
Wed, 11 Sep 2024 10:10:44 +0000 (13:10 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 11 Sep 2024 21:12:22 +0000 (23:12 +0200)
Closes #14858

lib/cf-socket.c
lib/connect.c

index 729e38f88947bed391a49a7d16697fce41f2d6f7..e4d6a5b86d73b7c49119acdf63e77b14f3c2d3b4 100644 (file)
@@ -1749,7 +1749,11 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf,
     return CURLE_OK;
   }
   case CF_QUERY_IP_INFO:
+#ifdef USE_IPV6
     *pres1 = (ctx->addr.family == AF_INET6)? TRUE : FALSE;
+#else
+    *pres1 = FALSE;
+#endif
     *(struct ip_quadruple *)pres2 = ctx->ip;
     return CURLE_OK;
   default:
index fb785f2750457752944f2a79c73aa92b67ba2c11..b9da7c16216e5ba9403a36b72f634500b496fe8c 100644 (file)
@@ -800,8 +800,10 @@ static CURLcode start_connect(struct Curl_cfilter *cf,
   }
   else {
     /* no user preference, we try ipv6 always first when available */
+#ifdef USE_IPV6
     ai_family0 = AF_INET6;
     addr0 = addr_first_match(remotehost->addr, ai_family0);
+#endif
     /* next candidate is ipv4 */
     ai_family1 = AF_INET;
     addr1 = addr_first_match(remotehost->addr, ai_family1);