From nobody Sat Feb 21 01:18:52 2026 X-Original-To: dev-commits-src-main@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 4fHq58351bz6TJNx for ; Sat, 21 Feb 2026 01:18:52 +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 4fHq581sWZz47SW for ; Sat, 21 Feb 2026 01:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771636732; 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=vFjfybVrICRJa5djjpUX0ZrrjEVGj37WcYSKwxtrzbs=; b=YzreiY0mKuq4hNHELSQ5F/k65wr+E1krTRV1ULzzoG/F0bpzf5Eq25oWQTWM2d4GycFWAI R95eYFEvJgdqYklGzvUmm6us6OZiK76eJVqNQ5uo8yxnAWCaQ+4ndJz5ysaVxmyvFK3YaN 7Xa+tfs3Gal0vw8wvKiGyXK1tkNVmwFFld2EMESjC3MKePlTmh7KdhZ3O47nzFRO0LODzv tQPtdgmKQggBfa6FasFJga663xQrf9jOWWuU1wRtmxQuWmB36wkwudrgS3okORBBAjlXg+ S4EUwvHdU0/pC17l+HnHMI4e745j5a85qLv6aKNVN0hL9vnfXOeJD2bhawtENw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771636732; a=rsa-sha256; cv=none; b=cNMMpn3nQfivA8IZTRkeSqEhdJLb8Cp6SIFFpgTL8D6AbP5y2/SJSHXOWN+aHpw+Dju92j I1elDGt5uRbwoXMABO8J+yZb9KIcJWFlfA9BYq0AtnEkuvdcIMTVTWToUnQZON1M4FKWcT sLRcKNJqcFoZw0KUrNxa/K57fcsjE6GMUgx6hP5U29rukiE9KIcAeKSZaPmtU/cG1Iw+fJ fxtN5wME3Z3paRsotP8ir17qLPfaGoOVdEcESWGcJB7xqMtO4gV/5uz14CPx6M21h1HIdC v3XcGOaK98nqivYR4+AM6gw7BKNFuubPGHkz51+WFOzqB68bfQX2StwhRpR0Yw== 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=1771636732; 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=vFjfybVrICRJa5djjpUX0ZrrjEVGj37WcYSKwxtrzbs=; b=gGFdXTf2rUcx2VEaXJk0K4x9fWIk/wlweEwkQKDGBRxIs4kBbcWx3qCvrlivN5IEOlXyKo YXlRMveRzAPBrvs1gbRT28VESfBCjhicOMGhM2o9Gpun0cLRkCgFj9hLy6FCxRhI6w6pTh JI65kKGjPjtKd3KLolQFEtVoaboC06Gm3cyhFSx7IBkVaU6Q9iEm2Vb/g5/hOVFLcd2gb4 LLGpGUEg2j+QJGZcEEFkp8eKfDJY4o+lZdxF3Ms3QSiythuq4GnUA2dv1CBd9NQZrXuPJS Ys+PzxB0Sph9TtzGBLVxCVhgpy36aR+bVl5eheVfG7qozOs0YyknkfPTkiP1+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fHq581QlWzsFh for ; Sat, 21 Feb 2026 01:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 401ed by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 21 Feb 2026 01:18:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: afbdcd402bb4 - main - libfetch: Fail hard if interrupted while connecting List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: afbdcd402bb439bd3d487baaad63b68e95929265 Auto-Submitted: auto-generated Date: Sat, 21 Feb 2026 01:18:52 +0000 Message-Id: <699907fc.401ed.6287cffc@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=afbdcd402bb439bd3d487baaad63b68e95929265 commit afbdcd402bb439bd3d487baaad63b68e95929265 Author: Dag-Erling Smørgrav AuthorDate: 2026-02-21 01:18:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-02-21 01:18:15 +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 --- 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 825b1960208c..b3250940becc 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -651,7 +651,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);