From feb609f28bc038b158d6e5f00e2aa30473b31d6e Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Mon, 8 Jun 2026 22:48:45 +0300 Subject: [PATCH] cf-socket: store errno from do_connect in ctx->error This fixes a misleading log in verbose mode when ipv6 connectivity isn't available, presumably also in other cases: ``` * Immediate connect fail for 2a00:1450:4028:806::200e: Network is unreachable * connect to 2a00:1450:4028:806::200e port 443 from :: port 0 failed: Success ``` Closes #21914 --- lib/cf-socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index f2d867276b..9496e0e9e8 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1319,6 +1319,7 @@ static CURLcode cf_tcp_connect(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "local address %s port %d...", ctx->ip.local_ip, ctx->ip.local_port); if(rc == -1) { + ctx->error = error; result = socket_connect_result(data, ctx->ip.remote_ip, error); goto out; }