From: Ryan Schmidt Date: Thu, 26 Jan 2023 01:30:23 +0000 (-0600) Subject: connect: Fix build when not ENABLE_IPV6 X-Git-Tag: curl-7_88_0~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a45abfbf6c5e366b05524301e1dfeacf348be26;p=thirdparty%2Fcurl.git connect: Fix build when not ENABLE_IPV6 Check for ENABLE_IPV6 before accessing AF_INET6. Fixes build failure introduced in 1c5d8ac. Closes https://github.com/curl/curl/pull/10344 --- diff --git a/lib/connect.c b/lib/connect.c index bff1bb1506..6bdb9e3cab 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -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;