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=202606 header.b=SPgueUCx; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 20FBF5A0269 for ; Tue, 16 Jun 2026 03:09:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1781572178; bh=+1t3LHvDlhcXd2ek9nCZeHHnBlnHBx72M1rIH90ExPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SPgueUCxzurCbqvQMqALOMPjbLSgJ7hKnXHoex3rGL/0zbbh2kPHxmUpTlQH11E2v xCPcFVOp3wrQ8i4i24jslonpIGUuMffVNJKnNE+hrBsjLYThAUU7yV+aqt2Rpx0v4M hOv3IzeLcpaAA3i1RAIaLZWZKLEjUPk59p2stpeCWqw9/StWBBlhhjRA++KwC8uuo0 9aiZGf5Gl+5HI2EsDfYvhEKl8eIKukqdc4BQ39LNMHdSDJ6Vt3mTHRlE9tDIXeHiBv DR+QdcRWX3s0ObNzBc+Rrx3nnsnkEpOze/8B37aRdciWmmpv6Ua6DX0gFaip+9mVaK UaZKWDb8qd+VA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gfTRQ4XdDz4xSR; Tue, 16 Jun 2026 11:09:38 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v2 1/4] flow: Correct misleading signature of flowside_sock_l4() Date: Tue, 16 Jun 2026 11:09:33 +1000 Message-ID: <20260616010936.1672156-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616010936.1672156-1-david@gibson.dropbear.id.au> References: <20260616010936.1672156-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: RQ45SDGGVYYMKRWHZ24BBJPZDGL7TINA X-Message-ID-Hash: RQ45SDGGVYYMKRWHZ24BBJPZDGL7TINA 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: flowside_sock_l4() takes a @tgt parameter with the side to create a socket for. The name is misleading, however, although ICMP only uses it for the target side of the flow, UDP can use it for either or both sides. TCP doesn't use it at all. Rename it to @side. While we're there remove the stale comment for the @data paremeter which was removed in 05972c7c4daf. Fixes: 05972c7c4daf ("util: Move epoll registration out of sock_l4_sa()") Signed-off-by: David Gibson --- flow.c | 11 +++++------ flow.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/flow.c b/flow.c index 565ed2b2..7a5c81c2 100644 --- a/flow.c +++ b/flow.c @@ -207,25 +207,24 @@ static int flowside_sock_splice(void *arg) * @c: Execution context * @type: Socket epoll type * @pif: Interface for this socket - * @tgt: Target flowside - * @data: epoll reference portion for protocol handlers + * @side: Flowside to create a socket for * - * Return: socket fd of protocol @proto bound to our address and port from @tgt + * Return: socket fd of protocol @proto bound to our address and port from @side * (if specified). */ int flowside_sock_l4(const struct ctx *c, enum epoll_type type, uint8_t pif, - const struct flowside *tgt) + const struct flowside *side) { const char *ifname = NULL; union sockaddr_inany sa; assert(pif_is_socket(pif)); - pif_sockaddr(c, &sa, pif, &tgt->oaddr, tgt->oport); + pif_sockaddr(c, &sa, pif, &side->oaddr, side->oport); switch (pif) { case PIF_HOST: - if (inany_is_loopback(&tgt->oaddr)) + if (inany_is_loopback(&side->oaddr)) ifname = NULL; else if (sa.sa_family == AF_INET) ifname = c->ip4.ifname_out; diff --git a/flow.h b/flow.h index 6c6a9260..2623b3db 100644 --- a/flow.h +++ b/flow.h @@ -173,7 +173,7 @@ static inline bool flowside_eq(const struct flowside *left, } int flowside_sock_l4(const struct ctx *c, enum epoll_type type, uint8_t pif, - const struct flowside *tgt); + const struct flowside *side); int flowside_connect(const struct ctx *c, int s, uint8_t pif, const struct flowside *tgt); -- 2.54.0