diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2023-08-22 15:29:55 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-08-22 12:15:27 +0200 |
commit | 8aa32009edb74aa1f0b6d58e759d5111a4713346 (patch) | |
tree | 8cabeeaa01e30bf085e9d4ff953af32fe74271cd /tcp.c | |
parent | bccfbff1936f5878a9dd9718200a1751f3bff64b (diff) | |
download | passt-8aa32009edb74aa1f0b6d58e759d5111a4713346.tar passt-8aa32009edb74aa1f0b6d58e759d5111a4713346.tar.gz passt-8aa32009edb74aa1f0b6d58e759d5111a4713346.tar.bz2 passt-8aa32009edb74aa1f0b6d58e759d5111a4713346.tar.lz passt-8aa32009edb74aa1f0b6d58e759d5111a4713346.tar.xz passt-8aa32009edb74aa1f0b6d58e759d5111a4713346.tar.zst passt-8aa32009edb74aa1f0b6d58e759d5111a4713346.zip |
tcp: Consistent usage of ports in tcp_seq_init()
In tcp_seq_init() the meaning of "src" and "dst" isn't really clear since
it's used for connections in both directions. However, these values are
just feeding a hash, so as long as we're consistent and include all the
information we want, it doesn't really matter.
Oddly, for the "src" side we supply the (tap side) forwarding address but
the (tap side) endpoint port. This again doesn't really matter, but it's
confusing. So swap this with dstport, so "src" is always forwarding
and "dst" is always endpoint.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r-- | tcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1857,8 +1857,8 @@ static void tcp_seq_init(const struct ctx *c, struct tcp_tap_conn *conn, in_port_t dstport; } __attribute__((__packed__)) in = { .src = conn->faddr, - .srcport = conn->eport, - .dstport = conn->fport, + .srcport = conn->fport, + .dstport = conn->eport, }; uint32_t ns, seq = 0; |