diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-09-16 08:20:50 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-09-16 08:20:50 +0200 |
commit | a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d (patch) | |
tree | 5e7477af309feb1c551123a48bb74463ce0d3d6e /tcp.c | |
parent | 3be131280d0f2c7f834b54cee5346918ab8b2aac (diff) | |
download | passt-a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d.tar passt-a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d.tar.gz passt-a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d.tar.bz2 passt-a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d.tar.lz passt-a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d.tar.xz passt-a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d.tar.zst passt-a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d.zip |
tcp: Fix setting window from maximum ACK sequence in batch
If we're at the first message in a batch, it's safe to get the
window value from it, and there's no need to subtract anything for
a comparison on that's not even done -- we'll override it later in
any case if we find messages with a higher ACK sequence number.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r-- | tcp.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -2002,12 +2002,8 @@ static void tcp_data_from_tap(struct ctx *c, struct tcp_tap_conn *conn, seq = ntohl(th->seq); ack_seq = ntohl(th->ack_seq); - if (!i) { - if (count == 1) - max_ack_seq_wnd = ntohs(th->window); - else - max_ack_seq_wnd = ntohs(th->window) - 1; - } + if (!i) + max_ack_seq_wnd = ntohs(th->window); if (th->ack) { ack = 1; |