From 04d3d026032415cac1c3083ffaf56977da27c3a7 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 28 Feb 2024 22:25:11 +1100 Subject: 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 Signed-off-by: Stefano Brivio --- tcp_splice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tcp_splice.h') 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 */ -- cgit v1.2.3