From: Frédéric Lécaille Date: Sat, 25 Feb 2023 10:27:34 +0000 (+0100) Subject: BUG/MINOR: quic: Remove force_ack for Initial,Handshake packets X-Git-Tag: v2.8-dev5~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3562a38154f12da5d0015166bf965155c619bf7;p=thirdparty%2Fhaproxy.git BUG/MINOR: quic: Remove force_ack for Initial,Handshake packets This is an old bug which arrived in this commit due to a misinterpretation of the RFC I guess where the desired effect was to acknowledge all the handshake packets: 77ac6f566 BUG/MINOR: quic: Missing acknowledgments for trailing packets This had as bad effect to acknowledge all the handshake packets even the ones which are not ack-eliciting. Must be backported to 2.7 and 2.6. --- diff --git a/src/quic_conn.c b/src/quic_conn.c index 5587bae41a..85513bc86a 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -4152,7 +4152,7 @@ static inline int qc_treat_rx_crypto_frms(struct quic_conn *qc, * Return 1 if succeeded, 0 if not. */ int qc_treat_rx_pkts(struct quic_conn *qc, struct quic_enc_level *cur_el, - struct quic_enc_level *next_el, int force_ack) + struct quic_enc_level *next_el) { int ret = 0; struct eb64_node *node; @@ -4188,7 +4188,7 @@ int qc_treat_rx_pkts(struct quic_conn *qc, struct quic_enc_level *cur_el, else { struct quic_arng ar = { .first = pkt->pn, .last = pkt->pn }; - if (pkt->flags & QUIC_FL_RX_PACKET_ACK_ELICITING || force_ack) { + if (pkt->flags & QUIC_FL_RX_PACKET_ACK_ELICITING) { qel->pktns->flags |= QUIC_FL_PKTNS_ACK_REQUIRED; qel->pktns->rx.nb_aepkts_since_last_ack++; qc_idle_timer_rearm(qc, 1); @@ -4597,7 +4597,7 @@ struct task *quic_conn_app_io_cb(struct task *t, void *context, unsigned int sta if (!LIST_ISEMPTY(&qel->rx.pqpkts) && qc_qel_may_rm_hp(qc, qel)) qc_rm_hp_pkts(qc, qel); - if (!qc_treat_rx_pkts(qc, qel, NULL, 0)) { + if (!qc_treat_rx_pkts(qc, qel, NULL)) { TRACE_DEVEL("qc_treat_rx_pkts() failed", QUIC_EV_CONN_IO_CB, qc); goto out; } @@ -4643,7 +4643,7 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state) /* Early-data encryption level */ struct quic_enc_level *eqel; struct buffer *buf = NULL; - int st, force_ack, zero_rtt; + int st, zero_rtt; TRACE_ENTER(QUIC_EV_CONN_IO_CB, qc); eqel = &qc->els[QUIC_TLS_ENC_LEVEL_EARLY_DATA]; @@ -4684,9 +4684,7 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state) if (!LIST_ISEMPTY(&qel->rx.pqpkts) && qc_qel_may_rm_hp(qc, qel)) qc_rm_hp_pkts(qc, qel); - force_ack = qel == &qc->els[QUIC_TLS_ENC_LEVEL_INITIAL] || - qel == &qc->els[QUIC_TLS_ENC_LEVEL_HANDSHAKE]; - if (!qc_treat_rx_pkts(qc, qel, next_qel, force_ack)) + if (!qc_treat_rx_pkts(qc, qel, next_qel)) goto out; if (qc->flags & QUIC_FL_CONN_TO_KILL) {