From nobody Thu Feb 26 04:22:51 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fLyx74Fvpz6TDtl for ; Thu, 26 Feb 2026 04:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fLyx72pd7z3JdB for ; Thu, 26 Feb 2026 04:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772079771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=He/gy0Zmi2bGBDfLuedPPurf9b95aK0J43puopGH454=; b=mSg099ubg6T/crw2MrNpn9wtyyPMt0Hbq8A4K8mJ2QXlElOjnKy4Is/N0kbjVtiaiLD4Ts rZSSEH+t++c8RossqL3ehqMXce4wuEPebd8hxRM3sikkX4nv+z7QFGiKpL2sdFNNvRaJP6 8EsmQmdPX9ar4GWqwCoDPg3PAYuAcpdFR0jDLOsAexWxro2f8IzTaj9NZu3TLkOBNwvqCS sSgiaZqeSW6gNAOFphtnzjiHDM1rxGi+zTgdS7zUVk+MN9Xr8NUgXWBD7FFrd1uSvqfje8 LMhVnfGlpw3KSIyqjH/sxdxYU+YT806UtgmrhCnnWmOZ+5m2opKu60hmJR1GNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772079771; a=rsa-sha256; cv=none; b=ugVEAnHiUrGVsF4uaC/CQO5IcmNz20A8AcX5VE+pBWPYG5higxgEIqaiNw1EZXeYYi+pcy 1HS/jN5mzkZLn2J0Y4LXJJ//kF+RbNwMTUUmDUqekitqkqRz27mymDw43tg9751FEPOc85 oZfJzPZ1V1WDuIIohNPmxdk5YfkBxC0Pg5gJc6p0VZIqFOv6k/juqzCq4a62+I+e8GnIHw 0x7Kc40ObdrJjziK0r54VxU7h4nsGOVC93WCT+EVj1CirSHoBjK/Sm4Ikcw+mnmR6xrm/n 1JhHp7D1pzlHhk+eGdWUKcdDRhCu3RgSVyqYOKb9NYStncjqRcaC0Nth6uE+hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772079771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=He/gy0Zmi2bGBDfLuedPPurf9b95aK0J43puopGH454=; b=lfJrOOZ4bYXUHXjby18SSUCQHJxLALiriQ6oY3jFGM20vx0neY+JdJ4UoZFu48ttFjUUeY avFR9m4H+6B0Mze/FnrfgLreo+gQzhCxqIRSG13FDSaSUsgv0aYrh9uCQjuvJhj+2XjepN w24tRUT7EoEAhryXRIGjBTBIsOVj3Oh9qHbCaJQCYKB0ddLWjdG0OegIvcBzYU1MM3Pxve eIzZJHxF3KX9TcH8gFEXArLxkdw9/r2oU/L5R1V3b1wLGUQ8Qt27F1Fg0L3l/F1dq992RR BWc2rgzH41OGFekn2ZOtfj7pysPhpe2RTwxdFO/j58Y15pshpfyCcqtDbq9/cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fLyx72Djrz1LK for ; Thu, 26 Feb 2026 04:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36990 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 26 Feb 2026 04:22:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: cca6f5eadb79 - stable/14 - libfetch: Fail hard if interrupted while connecting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cca6f5eadb796b03379eb21f38c74ca46a64e45b Auto-Submitted: auto-generated Date: Thu, 26 Feb 2026 04:22:51 +0000 Message-Id: <699fca9b.36990.1a140c64@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=cca6f5eadb796b03379eb21f38c74ca46a64e45b commit cca6f5eadb796b03379eb21f38c74ca46a64e45b Author: Dag-Erling Smørgrav AuthorDate: 2026-02-21 01:18:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-02-26 04:03:43 +0000 libfetch: Fail hard if interrupted while connecting This fixes an issue where the first address that DNS returns is blocked by a packet filter, so we hang for a while, then the user hits Ctrl-C, interrupting connect(2), whereupon we move on to the next address, get a connection, request the file, and return to fetch(1), which sees that SIGINT was caught and bails. Note that we make no attempt to enforce fetchTimeout in the connection phase, and never have. It's feasible, but non-trivial, so we'll leave it as an exercise for future us. PR: 293312 MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55406 (cherry picked from commit afbdcd402bb439bd3d487baaad63b68e95929265) --- lib/libfetch/common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index bff83ed905f6..784da2d9e6a2 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -652,7 +652,13 @@ fetch_connect(const char *host, int port, int af, int verbose) goto syserr; } /* attempt to connect to server address */ - if ((err = connect(sd, sai->ai_addr, sai->ai_addrlen)) == 0) + while ((err = connect(sd, sai->ai_addr, sai->ai_addrlen)) < 0) { + if (errno == EINTR && fetchRestartCalls) + continue; + break; + } + /* success? */ + if (err == 0) break; /* clean up before next attempt */ close(sd);