From: Frédéric Lécaille Date: Mon, 27 Dec 2021 17:13:13 +0000 (+0100) Subject: MINOR: quic: Wrong packet number space computation for PTO X-Git-Tag: v2.6-dev1~181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09e0f8319d1125a3ab651a63ef7a888e29c1fbc0;p=thirdparty%2Fhaproxy.git MINOR: quic: Wrong packet number space computation for PTO This leaded to make quic_pto_pktns() return 01RTT packet number space when initiating a probing even if the handshake was not completed! --- diff --git a/include/haproxy/quic_loss.h b/include/haproxy/quic_loss.h index 04b5084bd2..6105ceaeb4 100644 --- a/include/haproxy/quic_loss.h +++ b/include/haproxy/quic_loss.h @@ -130,7 +130,7 @@ static inline struct quic_pktns *quic_pto_pktns(struct quic_conn *qc, int i; unsigned int duration, lpto, time_of_last_eliciting; struct quic_loss *ql = &qc->path->loss; - struct quic_pktns *pktns; + struct quic_pktns *pktns, *p; TRACE_ENTER(QUIC_EV_CONN_SPTO, qc); duration = @@ -152,14 +152,12 @@ static inline struct quic_pktns *quic_pto_pktns(struct quic_conn *qc, } lpto = TICK_ETERNITY; - pktns = &qc->pktns[QUIC_TLS_PKTNS_INITIAL]; + pktns = p = &qc->pktns[QUIC_TLS_PKTNS_INITIAL]; for (i = QUIC_TLS_PKTNS_INITIAL; i < QUIC_TLS_PKTNS_MAX; i++) { unsigned int tmp_pto; - struct quic_pktns *p; - p = &qc->pktns[i]; - if (!p->tx.in_flight) + if (!qc->pktns[i].tx.in_flight) continue; if (i == QUIC_TLS_PKTNS_01RTT) { @@ -171,6 +169,7 @@ static inline struct quic_pktns *quic_pto_pktns(struct quic_conn *qc, duration += qc->max_ack_delay << ql->pto_count; } + p = &qc->pktns[i]; time_of_last_eliciting = p->tx.time_of_last_eliciting; tmp_pto = tick_first(lpto, tick_add(time_of_last_eliciting, duration));