From nobody Thu Feb 26 04:22:49 2026 X-Original-To: dev-commits-src-branches@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 4fLyx56pVMz6TDx6 for ; Thu, 26 Feb 2026 04:22:49 +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 4fLyx54SwVz3JgJ for ; Thu, 26 Feb 2026 04:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772079769; 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=H8jJ8idyKJmg7usb7pahZxa/35zuHtcvJ6nNIANLmFI=; b=HBUh99qFt0oCNY1/H2aUF857K97rw7kr7fgA2v97IBIVMF01/11PpzYZ1ySEmNpqtJ80DJ nIICLT/vE941f4uR9whsCXK8Bv24/KbnjvnbastIzGLWf6ByU0IzQ7lc0M0nMTO/+qIrjX DDStugypTQQm0jMfcZPlH7iGB48Jl8URcQ2T7o2qM3DQZl2a1wZ+4hfRycRGg6F3kABRtq ZKYQNK5CzQkeAhndWqQ21axp9H/3AO+/NZ6UXaqMg8E+0DEO/AHWfGkjjXKRwbaOZUBq/o 6c2FoGOEI4z5WGnXHR9eL9exd4S1EyyIiVYqJfzPTCuRy/w4WKXf/gtR/9Afpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772079769; a=rsa-sha256; cv=none; b=RzXkYJ5V9J6lCZ3Yyu21wlbRhCvPWrYnKaPjBAoe1bjhX8fM339INPyTsQEAOFfqQ2eUbv a+ZjkhvKbtuEd+mi5pXxyguZ06ebiJVpbzMZkuPExq0W2h2rXalwZnbo3pRN9bLpWMV84s 75p04P9C/Kx0kuuk0zL8YVdSh+6iAPnaHHdI8oHxRqBTN+ISsSRpVCtY9NQPzLSDREO2Bk 3dQWmy+Ph1XSgW17+BuO9nDsAMZ9Zyi/w6GmDdKgS/ujKXixpbTNt3Fneka6GJzfWWdaET eZwHK8WmQ2YDXMd7dkJ7mRReZR6SJahLNI2HgVqgfDq4E6Kl6k/2ZZILGQBu1w== 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=1772079769; 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=H8jJ8idyKJmg7usb7pahZxa/35zuHtcvJ6nNIANLmFI=; b=vDRkyeseJvAuziatx2guCUabOzWyrgHeR+jWcGdaL88dZErOg7d/gl9EATV0iK0dbawlpb ElGWzHi4vgudAl3b0Yk3A1JP0LHAF6lBCh1Py4vAjXoiiqdV/spWk6gCHEk56VepOml/ia sam3KGqYlUXnnPrLsf6Xd02p0vR9QFStKiW+ey8shJaxjPecwVnNhjT8jisdJOUV7fd/XM y4qDn2i0ohZBE7mZ3tftBhoeEFUQ5qmaYIvdkVOMgVcE67icHwWLct0iFlNrjIcPKK3ngE du8YEY4Yi1/JwB6w9VM0uPPMMYLih7s6bisPRdZ34nK68bf2ho8hG+fKVjAZ5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fLyx53kmdz1b4 for ; Thu, 26 Feb 2026 04:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3680b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 26 Feb 2026 04:22:49 +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: 3b879f771bd4 - stable/15 - libfetch: Fail hard if interrupted while connecting List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/15 X-Git-Reftype: branch X-Git-Commit: 3b879f771bd462948320373dee7b0e5f281e8e08 Auto-Submitted: auto-generated Date: Thu, 26 Feb 2026 04:22:49 +0000 Message-Id: <699fca99.3680b.479bbc5f@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3b879f771bd462948320373dee7b0e5f281e8e08 commit 3b879f771bd462948320373dee7b0e5f281e8e08 Author: Dag-Erling Smørgrav AuthorDate: 2026-02-21 01:18:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-02-26 04:02:28 +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 0bb65b0b8268..9d31b175c0fc 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);