Every duplicate ACK unconditionally triggered a fast retransmit,
even when the ACK sequence hadn't advanced.
Guard fast retransmit on !conn->retries, and increment retries
after the first retransmit. This is a quick fix to stop the
amplification storm. Full compliance with RFC 5681 Section 3.2
(three duplicate ACKs) is left to a later patch.
Link: https://bugs.passt.top/show_bug.cgi?id=224
Signed-off-by: Anshu Kumari
---
tcp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tcp.c b/tcp.c
index 95f4f3e1..d3d65f76 100644
--- a/tcp.c
+++ b/tcp.c
@@ -2082,7 +2082,9 @@ static int tcp_data_from_tap(const struct ctx *c, struct tcp_tap_conn *conn,
tcp_tap_window_update(c, conn, max_ack_seq_wnd, now);
- if (retr) {
+ if (retr && !conn->retries) {
+ conn->retries++;
+
flow_trace(conn,
"fast re-transmit, ACK: %u, previous sequence: %u",
conn->seq_ack_from_tap, conn->seq_to_tap);
@@ -2443,7 +2445,9 @@ int tcp_tap_handler(const struct ctx *c, uint8_t pif, sa_family_t af,
tcp_update_seqack_from_tap(c, conn, ntohl(th->ack_seq),
now);
- if (retr) {
+ if (retr && !conn->retries) {
+ conn->retries++;
+
flow_trace(conn,
"fast re-transmit, ACK: %u, previous sequence: %u",
ntohl(th->ack_seq), conn->seq_to_tap);
--
2.55.0