On Thu, Dec 04, 2025 at 08:45:41AM +0100, Stefano Brivio wrote:
...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 76a9daf..fc986a2 100644 --- a/tcp.c +++ b/tcp.c @@ -1972,13 +1972,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) { -- 2.43.0
-- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson