From: Frédéric Lécaille Date: Tue, 3 May 2022 14:09:08 +0000 (+0200) Subject: BUG/MINOR: quic: Wrong unit for ack delay for incoming ACK frames X-Git-Tag: v2.6-dev10~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6e859446907ee22a16268f7e9fffb321c3a5c23;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h index 6ff29b4cd5..6457fa4b1e 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)