]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Missing in flight ack eliciting packet counter decrement
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 1 Aug 2022 12:07:50 +0000 (14:07 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Wed, 3 Aug 2022 10:59:59 +0000 (12:59 +0200)
The decrement was missing in quic_pktns_tx_pkts_release() called each time a
packet number space is discarded. This is not sure this bug could have an impact
during handshakes. This counter is used to cancel the timer used both for packet
detection and PTO, setting its value to null. So there could be retransmissions
or probing which could be triggered for nothing.

Must be backported to 2.6.

include/haproxy/xprt_quic.h
src/xprt_quic.c

index 9f42bd1153cb2c3ccbca4268db85ea561cb22092..ee08a7d8a6b394427ce5049812d7eccb559ca292 100644 (file)
@@ -542,7 +542,7 @@ static inline void quic_tx_packet_refdec(struct quic_tx_packet *pkt)
        }
 }
 
-static inline void quic_pktns_tx_pkts_release(struct quic_pktns *pktns)
+static inline void quic_pktns_tx_pkts_release(struct quic_pktns *pktns, struct quic_conn *qc)
 {
        struct eb64_node *node;
 
@@ -553,6 +553,8 @@ static inline void quic_pktns_tx_pkts_release(struct quic_pktns *pktns)
 
                pkt = eb64_entry(node, struct quic_tx_packet, pn_node);
                node = eb64_next(node);
+               if (pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING)
+                       qc->path->ifae_pkts--;
                list_for_each_entry_safe(frm, frmbak, &pkt->frms, list) {
                        LIST_DELETE(&frm->list);
                        quic_tx_packet_refdec(frm->pkt);
@@ -581,7 +583,7 @@ static inline void quic_pktns_discard(struct quic_pktns *pktns,
        pktns->tx.loss_time = TICK_ETERNITY;
        pktns->tx.pto_probe = 0;
        pktns->tx.in_flight = 0;
-       quic_pktns_tx_pkts_release(pktns);
+       quic_pktns_tx_pkts_release(pktns, qc);
 }
 
 /* Initialize <p> QUIC network path depending on <ipv4> boolean
index 67ab817df574d68d2c12c194a871b19c712a436b..a6e257d7afa6b68ab4dc86e0fdc0175cc1258bbe 100644 (file)
@@ -4137,7 +4137,7 @@ static void quic_conn_release(struct quic_conn *qc)
        pool_free(pool_head_quic_tls_secret, app_tls_ctx->tx.secret);
 
        for (i = 0; i < QUIC_TLS_PKTNS_MAX; i++) {
-               quic_pktns_tx_pkts_release(&qc->pktns[i]);
+               quic_pktns_tx_pkts_release(&qc->pktns[i], qc);
                quic_free_arngs(&qc->pktns[i].rx.arngs);
        }