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.
This commit is contained in:
Frédéric Lécaille 2022-05-03 16:09:08 +02:00
parent 5b988ebed1
commit f6e8594469

View 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)