diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-06-16 11:09:33 +1000 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-06-16 23:49:53 +0200 |
| commit | 6d1f38cad752b818ea5be523896f1ceab4c12db0 (patch) | |
| tree | 0cd961ddad87ecbf566ca68bfc0ded81ead4aed3 | |
| parent | 900ea8b46b7e978f55d61c5bdf0bef0f011972e7 (diff) | |
| download | passt-6d1f38cad752b818ea5be523896f1ceab4c12db0.tar passt-6d1f38cad752b818ea5be523896f1ceab4c12db0.tar.gz passt-6d1f38cad752b818ea5be523896f1ceab4c12db0.tar.bz2 passt-6d1f38cad752b818ea5be523896f1ceab4c12db0.tar.lz passt-6d1f38cad752b818ea5be523896f1ceab4c12db0.tar.xz passt-6d1f38cad752b818ea5be523896f1ceab4c12db0.tar.zst passt-6d1f38cad752b818ea5be523896f1ceab4c12db0.zip | |
flow: Correct misleading signature of flowside_sock_l4()
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>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | flow.c | 11 | ||||
| -rw-r--r-- | flow.h | 2 |
2 files changed, 6 insertions, 7 deletions
@@ -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; @@ -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); |
