← Commit list

003689c3d3

Viktor Szakats
Viktor Szakats
2025-11-30
SUCCESS Duration: 156s

Subject

cf-socket: drop feature check for `IPV6_V6ONLY` on Windows

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/cf-socket.c+12 -17
@@ -83,22 +83,6 @@
#include "curlx/strparse.h"
-#if defined(USE_IPV6) && defined(IPV6_V6ONLY) && defined(_WIN32)
-/* It makes support for IPv4-mapped IPv6 addresses.
- * Linux kernel, NetBSD, FreeBSD and Darwin: default is off;
- * Windows Vista and later: default is on;
- * DragonFly BSD: acts like off, and dummy setting;
- * OpenBSD and earlier Windows: unsupported.
- * Linux: controlled by /proc/sys/net/ipv6/bindv6only.
- */
-static void set_ipv6_v6only(curl_socket_t sockfd, int on)
-{
- (void)setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(on));
-}
-#else
-#define set_ipv6_v6only(x, y)
-#endif
-
static void tcpnodelay(struct Curl_cfilter *cf,
struct Curl_easy *data,
curl_socket_t sockfd)
@@ -1114,7 +1098,18 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf,
#ifdef USE_IPV6
if(ctx->addr.family == AF_INET6) {
- set_ipv6_v6only(ctx->sock, 0);
+#ifdef USE_WINSOCK
+ /* Turn on support for IPv4-mapped IPv6 addresses.
+ * Linux kernel, NetBSD, FreeBSD, Darwin, lwIP: default is off;
+ * Windows Vista and later: default is on;
+ * DragonFly BSD: acts like off, and dummy setting;
+ * OpenBSD and earlier Windows: unsupported.
+ * Linux: controlled by /proc/sys/net/ipv6/bindv6only.
+ */
+ int on = 0;
+ (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_V6ONLY,
+ (void *)&on, sizeof(on));
+#endif
infof(data, " Trying [%s]:%d...", ctx->ip.remote_ip, ctx->ip.remote_port);
}
else