From: Frédéric Lécaille Date: Fri, 14 Apr 2023 07:56:17 +0000 (+0200) Subject: BUG/MINOR: quic: Do not use ack delay during the handshakes X-Git-Tag: v2.8-dev8~131 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5efe7901d3c4476822a2dea58858f5fb069c8eb;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/quic_conn.c b/src/quic_conn.c index 9ede4df93f..98b376e7e7 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;