MINOR: quic: Wrong ack_delay compution before calling quic_loss_srtt_update()

RFC 9002 5.3. Estimating smoothed_rtt and rttvar:
MUST use the lesser of the acknowledgment delay and the peer's max_ack_delay
after the handshake is confirmed.
This commit is contained in:
Frédéric Lécaille 2021-12-28 14:27:43 +01:00
parent dc90c07715
commit 22576a2e55
2 changed files with 5 additions and 3 deletions

View File

@ -42,8 +42,8 @@ static inline void quic_loss_init(struct quic_loss *ql)
}
/* Update <ql> QUIC loss information with new <rtt> measurement and <ack_delay>
* on ACK frame receipt which MUST be min(ack->ack_delay, max_ack_delay) for
* non handshake packets.
* on ACK frame receipt which MUST be min(ack->ack_delay, max_ack_delay)
* before the handshake is confirmed.
*/
static inline void quic_loss_srtt_update(struct quic_loss *ql,
unsigned int rtt, unsigned int ack_delay,

View File

@ -2208,7 +2208,9 @@ static int qc_parse_pkt_frms(struct quic_rx_packet *pkt, struct ssl_sock_ctx *ct
unsigned int ack_delay;
ack_delay = !quic_application_pktns(qel->pktns, qc) ? 0 :
MS_TO_TICKS(QUIC_MIN(quic_ack_delay_ms(&frm.ack, qc), qc->max_ack_delay));
HA_ATOMIC_LOAD(&qc->state) >= QUIC_HS_ST_CONFIRMED ?
MS_TO_TICKS(QUIC_MIN(quic_ack_delay_ms(&frm.ack, qc), qc->max_ack_delay)) :
MS_TO_TICKS(quic_ack_delay_ms(&frm.ack, qc));
quic_loss_srtt_update(&qc->path->loss, rtt_sample, ack_delay, qc);
}
break;