]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Wrong unit for ack delay for incoming ACK frames
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 3 May 2022 14:09:08 +0000 (16:09 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Thu, 12 May 2022 13:30:14 +0000 (15:30 +0200)
This ACK frame field value is in microseconds. Everything is interpreted
and stored in milliseconds in our QUIC implementation.

include/haproxy/xprt_quic.h

index 6ff29b4cd5a828a46bb3114712004cf663d8a712..6457fa4b1e91224e7bf9fdc9b022c716e0fa3b04 100644 (file)
@@ -467,13 +467,14 @@ static inline int quic_packet_number_encode(unsigned char **buf,
        return 1;
 }
 
-/* Returns the <ack_delay> field value from <ack_frm> ACK frame for
- * <conn> QUIC connection.
+/* Returns the <ack_delay> field value in milliseconds from <ack_frm> ACK frame for
+ * <conn> QUIC connection. Note that the value of <ack_delay> 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 <dst> transport parameters with default values (when absent)