aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-09-16 08:20:50 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-09-16 08:20:50 +0200
commita7eb8bb2f6f0cf4612ad932912fd3f681e8ebb2d (patch)
tree5e7477af309feb1c551123a48bb74463ce0d3d6e /tcp.c
parent3be131280d0f2c7f834b54cee5346918ab8b2aac (diff)
downloadpasst-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.c8
1 files changed, 2 insertions, 6 deletions
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;