public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 1/4] flow: Correct misleading signature of flowside_sock_l4()
Date: Tue,  9 Jun 2026 16:30:02 +1000	[thread overview]
Message-ID: <20260609063005.113744-2-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20260609063005.113744-1-david@gibson.dropbear.id.au>

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 <david@gibson.dropbear.id.au>
---
 flow.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 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;
-- 
2.54.0


  reply	other threads:[~2026-06-09  6:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  6:30 [PATCH 0/4] Assorted minor socket creation cleanups David Gibson
2026-06-09  6:30 ` David Gibson [this message]
2026-06-09  6:30 ` [PATCH 2/4] Makefile: Remove unused DUAL_STACK_SOCKETS define David Gibson
2026-06-09  6:30 ` [PATCH 3/4] fwd, pif: Remove duplicated logic between tcp_listen() and udp_listen() David Gibson
2026-06-09  6:30 ` [PATCH 4/4] pif, util: Move listen(2) call from sock_l4_() to pif_listen() David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260609063005.113744-2-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).