From: Frédéric Lécaille Date: Wed, 8 Jun 2022 08:09:39 +0000 (+0200) Subject: BUG/MINOR: quic: Wrong PTO calculation X-Git-Tag: v2.7-dev1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa94f77bc593be1846171b3277d61b2b4e7d7e1b;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/quic_loss.h b/include/haproxy/quic_loss.h index 1f63e30d42..180bb359ec 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,