On Tue, 6 Feb 2024 12:17:25 +1100
David Gibson <david(a)gibson.dropbear.id.au> wrote:
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.
Yeah, same here, it took me a while to check that what you're changing
to 'dstport' is actually a destination port (and not just because a
comment says that).
Yeah, I had a lot of confusion until I did that trace and realised
these were different things with the same name. Hence the patch.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!