From a55acf993a5795ed4f5255b30024a0dba10f15b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 19 Jun 2023 10:47:24 +0200 Subject: [PATCH] BUG/MINOR: quic: ticks comparison without ticks API use Replace a "less than" comparison between two tick variable by a call to tick_is_lt() in quic_loss_pktns(). This bug could lead to a wrong packet loss detection when the loss time computed values could wrap. This is the case 20 seconds after haproxy has started. Must be backported as far as 2.6. --- src/quic_loss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quic_loss.c b/src/quic_loss.c index c44515c67..37b40cc7b 100644 --- a/src/quic_loss.c +++ b/src/quic_loss.c @@ -66,7 +66,7 @@ struct quic_pktns *quic_loss_pktns(struct quic_conn *qc) for (i = QUIC_TLS_PKTNS_HANDSHAKE; i < QUIC_TLS_PKTNS_MAX; i++) { TRACE_PROTO("TX loss pktns", QUIC_EV_CONN_SPTO, qc, &qc->pktns[i]); if (!tick_isset(pktns->tx.loss_time) || - qc->pktns[i].tx.loss_time < pktns->tx.loss_time) + tick_is_lt(qc->pktns[i].tx.loss_time, pktns->tx.loss_time)) pktns = &qc->pktns[i]; }