]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
connect: Fix build when not ENABLE_IPV6
authorRyan Schmidt <git@ryandesign.com>
Thu, 26 Jan 2023 01:30:23 +0000 (19:30 -0600)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 26 Jan 2023 08:32:24 +0000 (03:32 -0500)
Check for ENABLE_IPV6 before accessing AF_INET6. Fixes build failure
introduced in 1c5d8ac.

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

lib/connect.c

index bff1bb1506bcf30e8aa6d1191fde081192d0f3f2..6bdb9e3cab94c3ab8c7b8c69efc20150c0c0c560 100644 (file)
@@ -395,7 +395,10 @@ static CURLcode eyeballer_new(struct eyeballer **pballer,
     return CURLE_OUT_OF_MEMORY;
 
   baller->name = ((ai_family == AF_INET)? "ipv4" : (
-                  (ai_family == AF_INET6)? "ipv6" : "ip"));
+#ifdef ENABLE_IPV6
+                  (ai_family == AF_INET6)? "ipv6" :
+#endif
+                  "ip"));
   baller->cf_create = cf_create;
   baller->addr = addr;
   baller->ai_family = ai_family;