aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-19 09:13:53 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-19 09:13:53 +0200
commit9e065b1448bc4df2c031916ef2317e22485ea599 (patch)
treedbb16819800e9f5a9024c4bb2c9f69434bac0928 /tcp.c
parent5496074862b8ec62a6f50b87d96a65c771b504a6 (diff)
downloadpasst-9e065b1448bc4df2c031916ef2317e22485ea599.tar
passt-9e065b1448bc4df2c031916ef2317e22485ea599.tar.gz
passt-9e065b1448bc4df2c031916ef2317e22485ea599.tar.bz2
passt-9e065b1448bc4df2c031916ef2317e22485ea599.tar.lz
passt-9e065b1448bc4df2c031916ef2317e22485ea599.tar.xz
passt-9e065b1448bc4df2c031916ef2317e22485ea599.tar.zst
passt-9e065b1448bc4df2c031916ef2317e22485ea599.zip
tcp: Fix ACK reporting on older kernels (no tcp.kernel_snd_wnd case)
If the window isn't updated on !c->tcp.kernel_snd_wnd, we still have to send ACKs if the ACK sequence was updated, or if an error occurred while querying TCP_INFO. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tcp.c b/tcp.c
index 6b256bf..3542827 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1558,16 +1558,16 @@ static int tcp_update_seqack_wnd(struct ctx *c, struct tcp_tap_conn *conn,
if (!c->tcp.kernel_snd_wnd) {
tcp_get_sndbuf(conn);
conn->wnd_to_tap = MIN(conn->snd_buf, MAX_WINDOW);
- return 0;
+ goto out;
}
if (!info) {
if (conn->wnd_to_tap > WINDOW_DEFAULT)
- return 0;
+ goto out;
info = &__info;
if (getsockopt(s, SOL_TCP, TCP_INFO, info, &sl))
- return 0;
+ goto out;
}
if (conn->local || tcp_rtt_dst_low(conn)) {
@@ -1579,6 +1579,7 @@ static int tcp_update_seqack_wnd(struct ctx *c, struct tcp_tap_conn *conn,
conn->wnd_to_tap = MIN(conn->wnd_to_tap, MAX_WINDOW);
+out:
return conn->wnd_to_tap != prev_wnd_to_tap ||
conn->seq_ack_to_tap != prev_ack_to_tap;
}