From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=Nq/AhElA; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id A2BBF5A0262 for ; Mon, 18 May 2026 05:22:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1779074566; bh=QeeHJJO/1Mh4bUVo0rFfIUk69y9e0k/uxQECgWo3dIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nq/AhElApQroUDgsoUyd6CNJeKsUCiiTqEfcOtsvUmoxDugd472uV1NOKwD9Bc0bv eHBJzyPTQ6zVII6blPT+diB9SylG33obE8DLa6GKl4xYZ2K80SJPyw3LfhywULTC5w aSV2AoPv3vn5GSIRD3tz6cGKytOe5saUrFa28pVFvc4tsxyUE37BSEkXy30UKnb+si +wU7al0lScjk2yjZ4579SjPVM5qx4zTDwqjpcaELX65/rzGUUCFV4qDtkW4pyvXN/f i+zJ/ZOQnFklopXpu974vabHQHu8AqAGxczHSZ+aWVGhIj9qPMH6U8enc+pSAzxoGu 09QgfkVS5zxpQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gJjmQ3w7lz4wTM; Mon, 18 May 2026 13:22:46 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v2 2/3] tap: Report accept() errors Date: Mon, 18 May 2026 13:22:42 +1000 Message-ID: <20260518032243.823768-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260518032243.823768-1-david@gibson.dropbear.id.au> References: <20260518032243.823768-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: HAW2MR5ID52APVO3JX72SSBPTB6D6U6L X-Message-ID-Hash: HAW2MR5ID52APVO3JX72SSBPTB6D6U6L X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Currently, if accept4() fails in tap_listen_handler(), we carry on as if it succeeded. Something will probably fail shortly down the line, but that's needlessly confusing. Report an error instead. Signed-off-by: David Gibson --- tap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tap.c b/tap.c index e7cac9df..660f1cb6 100644 --- a/tap.c +++ b/tap.c @@ -1491,6 +1491,10 @@ void tap_listen_handler(struct ctx *c, uint32_t events) } c->fd_tap = accept4(c->fd_tap_listen, NULL, NULL, SOCK_CLOEXEC); + if (c->fd_tap < 0) { + warn_perror("Error accepting tap client"); + return; + } if (!getsockopt(c->fd_tap, SOL_SOCKET, SO_PEERCRED, &ucred, &len)) info("accepted connection from PID %i", ucred.pid); -- 2.54.0