aboutgitcodebugslistschat
path: root/tcp_splice.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-02-28 22:25:11 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-02-29 09:48:03 +0100
commit04d3d026032415cac1c3083ffaf56977da27c3a7 (patch)
treeaa5f5f696f1eb64a71b45d60d481972c6ccef703 /tcp_splice.h
parent0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8 (diff)
downloadpasst-04d3d026032415cac1c3083ffaf56977da27c3a7.tar
passt-04d3d026032415cac1c3083ffaf56977da27c3a7.tar.gz
passt-04d3d026032415cac1c3083ffaf56977da27c3a7.tar.bz2
passt-04d3d026032415cac1c3083ffaf56977da27c3a7.tar.lz
passt-04d3d026032415cac1c3083ffaf56977da27c3a7.tar.xz
passt-04d3d026032415cac1c3083ffaf56977da27c3a7.tar.zst
passt-04d3d026032415cac1c3083ffaf56977da27c3a7.zip
tcp_splice: More specific variable names in new splice path
In tcp_splice_conn_from_sock(), the 'port' variable stores the source port of the connection on the originating side. In tcp_splice_new(), called directly from it, the 'port' parameter gives the _destination_ port of the originating connection and is then updated to the destination port of the connection on the other side. Similarly, in tcp_splice_conn_from_sock(), 's' is the fd of the accetped socket (on side 0), whereas in tcp_splice_new(), 's' is the fd of the connecting socket (side 1). I, for one, find having the same variable name with different meanings in such close proximity in the flow of control pretty confusing. Alter the names for greater specificity and clarity. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.h')
-rw-r--r--tcp_splice.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcp_splice.h b/tcp_splice.h
index 5a471af..d0c6ff7 100644
--- a/tcp_splice.h
+++ b/tcp_splice.h
@@ -13,7 +13,7 @@ void tcp_splice_sock_handler(struct ctx *c, union epoll_ref ref,
uint32_t events);
bool tcp_splice_conn_from_sock(const struct ctx *c,
union tcp_listen_epoll_ref ref, union flow *flow,
- int s, const union sockaddr_inany *sa);
+ int s0, const union sockaddr_inany *sa);
void tcp_splice_init(struct ctx *c);
#endif /* TCP_SPLICE_H */