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>
This commit is contained in:
parent
3be131280d
commit
a7eb8bb2f6
1 changed files with 2 additions and 6 deletions
6
tcp.c
6
tcp.c
|
@ -2002,12 +2002,8 @@ static void tcp_data_from_tap(struct ctx *c, struct tcp_tap_conn *conn,
|
||||||
|
|
||||||
seq = ntohl(th->seq);
|
seq = ntohl(th->seq);
|
||||||
ack_seq = ntohl(th->ack_seq);
|
ack_seq = ntohl(th->ack_seq);
|
||||||
if (!i) {
|
if (!i)
|
||||||
if (count == 1)
|
|
||||||
max_ack_seq_wnd = ntohs(th->window);
|
max_ack_seq_wnd = ntohs(th->window);
|
||||||
else
|
|
||||||
max_ack_seq_wnd = ntohs(th->window) - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (th->ack) {
|
if (th->ack) {
|
||||||
ack = 1;
|
ack = 1;
|
||||||
|
|
Loading…
Reference in a new issue