BUG/MINOR: quic: Missing TX packet deallocations
Ensure all TX packets are deallocated. There may be remaining ones which
will never be acknowledged or deemed lost.
diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h
index 09c19ce..9bf71e9 100644
--- a/include/haproxy/xprt_quic.h
+++ b/include/haproxy/xprt_quic.h
@@ -1018,27 +1018,10 @@
}
}
-/* Discard <pktns> packet number space attached to <qc> QUIC connection.
- * Its loss information are reset. Deduce the outstanding bytes for this
- * packet number space from the outstanding bytes for the path of this
- * connection.
- * Note that all the non acknowledged TX packets and their frames are freed.
- * Always succeeds.
- */
-static inline void quic_pktns_discard(struct quic_pktns *pktns,
- struct quic_conn *qc)
+static inline void quic_pktns_tx_pkts_release(struct quic_pktns *pktns)
{
struct eb64_node *node;
- qc->path->in_flight -= pktns->tx.in_flight;
- qc->path->prep_in_flight -= pktns->tx.in_flight;
- qc->path->loss.pto_count = 0;
-
- pktns->tx.time_of_last_eliciting = 0;
- pktns->tx.loss_time = TICK_ETERNITY;
- pktns->tx.pto_probe = 0;
- pktns->tx.in_flight = 0;
-
node = eb64_first(&pktns->tx.pkts);
while (node) {
struct quic_tx_packet *pkt;
@@ -1056,6 +1039,27 @@
}
}
+/* Discard <pktns> packet number space attached to <qc> QUIC connection.
+ * Its loss information are reset. Deduce the outstanding bytes for this
+ * packet number space from the outstanding bytes for the path of this
+ * connection.
+ * Note that all the non acknowledged TX packets and their frames are freed.
+ * Always succeeds.
+ */
+static inline void quic_pktns_discard(struct quic_pktns *pktns,
+ struct quic_conn *qc)
+{
+ qc->path->in_flight -= pktns->tx.in_flight;
+ qc->path->prep_in_flight -= pktns->tx.in_flight;
+ qc->path->loss.pto_count = 0;
+
+ pktns->tx.time_of_last_eliciting = 0;
+ pktns->tx.loss_time = TICK_ETERNITY;
+ pktns->tx.pto_probe = 0;
+ pktns->tx.in_flight = 0;
+ quic_pktns_tx_pkts_release(pktns);
+}
+
/* Initialize <p> QUIC network path depending on <ipv4> boolean
* which is true for an IPv4 path, if not false for an IPv6 path.
*/
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 32e293f..10d3285 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -3802,8 +3802,10 @@
pool_free(pool_head_quic_tls_secret, app_tls_ctx->rx.secret);
pool_free(pool_head_quic_tls_secret, app_tls_ctx->tx.secret);
- for (i = 0; i < QUIC_TLS_PKTNS_MAX; i++)
+ for (i = 0; i < QUIC_TLS_PKTNS_MAX; i++) {
+ quic_pktns_tx_pkts_release(&qc->pktns[i]);
quic_free_arngs(&qc->pktns[i].rx.arngs);
+ }
pool_free(pool_head_quic_conn_rxbuf, qc->rx.buf.area);
pool_free(pool_head_quic_conn, qc);