From c7c8764145d8f2993d0797e66abcd38a7a5e4055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 17 Sep 2021 17:17:16 +0200 Subject: [PATCH] MINOR: quic: Wrong packet number space selection in quic_loss_pktns() Ensure the tick is set for a packet number space loss time before selecting it. --- include/haproxy/quic_loss.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/haproxy/quic_loss.h b/include/haproxy/quic_loss.h index 16fe5aa31..ca7a02610 100644 --- a/include/haproxy/quic_loss.h +++ b/include/haproxy/quic_loss.h @@ -110,9 +110,10 @@ static inline struct quic_pktns *quic_loss_pktns(struct quic_conn *qc) pktns = &qc->pktns[QUIC_TLS_PKTNS_INITIAL]; TRACE_PROTO("pktns", QUIC_EV_CONN_SPTO, qc->conn, pktns); - for (i = QUIC_TLS_PKTNS_01RTT; i < QUIC_TLS_PKTNS_MAX; i++) { + for (i = QUIC_TLS_PKTNS_HANDSHAKE; i < QUIC_TLS_PKTNS_MAX; i++) { TRACE_PROTO("pktns", QUIC_EV_CONN_SPTO, qc->conn, &qc->pktns[i]); - if (qc->pktns[i].tx.loss_time < pktns->tx.loss_time) + if (tick_isset(pktns->tx.loss_time) && + qc->pktns[i].tx.loss_time < pktns->tx.loss_time) pktns = &qc->pktns[i]; }