From a7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 16 Sep 2021 08:20:50 +0200 Subject: 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 --- tcp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index 80458e3..1ad1050 100644 --- a/tcp.c +++ b/tcp.c @@ -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; -- cgit v1.2.3