]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Do not use ack delay during the handshakes
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 14 Apr 2023 07:56:17 +0000 (09:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Apr 2023 19:09:13 +0000 (21:09 +0200)
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

index 9ede4df93fc788bf325d1db3c9fbaecafa24b533..98b376e7e753d5f63e5319756394afc12d95a809 100644 (file)
@@ -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;