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.

(cherry picked from commit b3562a3815)
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
(cherry picked from commit 4b9a3733ccc1f776b24127134c57e971e3af556d)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
This commit is contained in:
Frédéric Lécaille 2023-02-25 11:27:34 +01:00 committed by Amaury Denoyelle
parent 7ee09e9445
commit ee7bfd6040

View File

@ -4057,7 +4057,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;
@ -4093,7 +4093,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);
@ -4444,7 +4444,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;
}
@ -4490,7 +4490,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];
@ -4541,9 +4541,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) {