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=202412 header.b=eBtUG5ZN; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id D31805A061F for ; Thu, 30 Jan 2025 08:26:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202412; t=1738221972; bh=qCk3SEHtJjIiFjiZRRg4XVS/C6CtIIfUA5lEQepfG2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eBtUG5ZN4zFroXUPVhKmoTKrssuMW5c+xaJwbY2zXM42cDzd/bAEz7ljk059ZaXNr dkn10wzzRPXBLe3cvwlMAF7dk6EemOnHPCkroxWXJMKobA0q8+ncU57FV7yiruMPjw rtM44k5mbUx9BrsoQMbu3rhRS4HPwkgBhrfqRtMFBpTyuqlDRg1ORHAIXpSOuV17Uo mzpdCWrhErJAF6hxwh90hu1pfKGiNLnijambvJGSMxuqtoIXpYyFRTjl6m7spCaknH yf4Ixl7f84xF09HZkBOtJapETlNTLD6pRp3jintxyOgs12sZMRHX5h1elzfWB7r6Fe YJuqG1/dE8ZUw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Yk9Yc497hz4x21; Thu, 30 Jan 2025 18:26:12 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 1/2] tcp: Always pass NULL event with EPOLL_CTL_DEL Date: Thu, 30 Jan 2025 17:52:10 +1100 Message-ID: <20250130065211.770325-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250130065211.770325-1-david@gibson.dropbear.id.au> References: <20250130065211.770325-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 2P4WPPIHAMA3UGPFPWQ4JL7JUZMD3PZA X-Message-ID-Hash: 2P4WPPIHAMA3UGPFPWQ4JL7JUZMD3PZA 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: In tcp_epoll_ctl() we pass an event pointer with EPOLL_CTL_DEL, even though it will be ignored. It's possible this was a workaround for pre-2.6.9 kernels which required a non-NULL pointer here, but we rely on the kernel accepting NULL events for EPOLL_CTL_DEL in lots of other places. Use NULL instead for simplicity and consistency. Signed-off-by: David Gibson --- tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcp.c b/tcp.c index c89f3232..4eed82bf 100644 --- a/tcp.c +++ b/tcp.c @@ -468,9 +468,9 @@ static int tcp_epoll_ctl(const struct ctx *c, struct tcp_tap_conn *conn) if (conn->events == CLOSED) { if (conn->in_epoll) - epoll_ctl(c->epollfd, EPOLL_CTL_DEL, conn->sock, &ev); + epoll_ctl(c->epollfd, EPOLL_CTL_DEL, conn->sock, NULL); if (conn->timer != -1) - epoll_ctl(c->epollfd, EPOLL_CTL_DEL, conn->timer, &ev); + epoll_ctl(c->epollfd, EPOLL_CTL_DEL, conn->timer, NULL); return 0; } -- 2.48.1