From f6e859446907ee22a16268f7e9fffb321c3a5c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Tue, 3 May 2022 16:09:08 +0200 Subject: [PATCH] BUG/MINOR: quic: Wrong unit for ack delay for incoming ACK frames This ACK frame field value is in microseconds. Everything is interpreted and stored in milliseconds in our QUIC implementation. --- include/haproxy/xprt_quic.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h index 6ff29b4cd..6457fa4b1 100644 --- a/include/haproxy/xprt_quic.h +++ b/include/haproxy/xprt_quic.h @@ -467,13 +467,14 @@ static inline int quic_packet_number_encode(unsigned char **buf, return 1; } -/* Returns the field value from ACK frame for - * QUIC connection. +/* Returns the field value in milliseconds from ACK frame for + * QUIC connection. Note that the value of coming from + * ACK frame is in microseconds. */ static inline unsigned int quic_ack_delay_ms(struct quic_ack *ack_frm, struct quic_conn *conn) { - return ack_frm->ack_delay << conn->tx.params.ack_delay_exponent; + return (ack_frm->ack_delay << conn->tx.params.ack_delay_exponent) / 1000; } /* Initialize transport parameters with default values (when absent)