From c93515c1bf93f270327cab0082dc03acb9dda625 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 4 Dec 2025 07:17:00 +0100 Subject: tcp: Skip redundant ACK on partial sendmsg() failure ...we'll send a duplicate ACK right away in this case, and this redundant, earlier check is not just useless, but it might actually be harmful as we'll now send a triple ACK which might cause two retransmissions. Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- tcp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tcp.c b/tcp.c index 2ad9764..17fda5d 100644 --- a/tcp.c +++ b/tcp.c @@ -2027,13 +2027,10 @@ eintr: return -1; } - if (n < (int)(seq_from_tap - conn->seq_from_tap)) { + if (n < (int)(seq_from_tap - conn->seq_from_tap)) partial_send = 1; - conn->seq_from_tap += n; - tcp_send_flag(c, conn, ACK_IF_NEEDED); - } else { - conn->seq_from_tap += n; - } + + conn->seq_from_tap += n; out: if (keep != -1 || partial_send) { -- cgit v1.2.3