From b5efe7901d3c4476822a2dea58858f5fb069c8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 14 Apr 2023 09:56:17 +0200 Subject: [PATCH] BUG/MINOR: quic: Do not use ack delay during the handshakes As revealed by GH #2120 opened by @Tristan971, there are cases where ACKs have to be sent without packet to acknowledge because the ACK timer has been triggered and the connection needs to probe the peer at the same time. Indeed Thank you to @Tristan971 for having reported this issue. Must be backported to 2.6 and 2.7. --- src/quic_conn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/quic_conn.c b/src/quic_conn.c index 9ede4df93..98b376e7e 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -4505,9 +4505,13 @@ int qc_treat_rx_pkts(struct quic_conn *qc, struct quic_enc_level *cur_el, struct quic_arng ar = { .first = pkt->pn, .last = pkt->pn }; if (pkt->flags & QUIC_FL_RX_PACKET_ACK_ELICITING) { + int arm_ack_timer = + qc->state >= QUIC_HS_ST_COMPLETE && + qel->pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT]; + qel->pktns->flags |= QUIC_FL_PKTNS_ACK_REQUIRED; qel->pktns->rx.nb_aepkts_since_last_ack++; - qc_idle_timer_rearm(qc, 1, 1); + qc_idle_timer_rearm(qc, 1, arm_ack_timer); } if (pkt->pn > largest_pn) { largest_pn = pkt->pn;