From fa94f77bc593be1846171b3277d61b2b4e7d7e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Wed, 8 Jun 2022 10:09:39 +0200 Subject: [PATCH] BUG/MINOR: quic: Wrong PTO calculation Due to missing brackets around the ternary C operator, quic_pto() could return zero at the first run, before the QUIC connection was completely initialized. This leaded the idle timeout task to be executed before this initialization completion. Then this connection could be immediately released. This bug was revealed by the multi_packet_client_hello QUIC tracker test. Must be backported to 2.6. --- include/haproxy/quic_loss.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/haproxy/quic_loss.h b/include/haproxy/quic_loss.h index 1f63e30d4..180bb359e 100644 --- a/include/haproxy/quic_loss.h +++ b/include/haproxy/quic_loss.h @@ -68,7 +68,7 @@ static inline unsigned int quic_pto(struct quic_conn *qc) struct quic_loss *ql = &qc->path->loss; return (ql->srtt >> 3) + QUIC_MAX(ql->rtt_var, QUIC_TIMER_GRANULARITY) + - HA_ATOMIC_LOAD(&qc->state) >= QUIC_HS_ST_COMPLETE ? qc->max_ack_delay : 0; + (HA_ATOMIC_LOAD(&qc->state) >= QUIC_HS_ST_COMPLETE ? qc->max_ack_delay : 0); } void quic_loss_srtt_update(struct quic_loss *ql,