]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Wrong packet number space computation for PTO
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 27 Dec 2021 17:13:13 +0000 (18:13 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 4 Jan 2022 16:30:00 +0000 (17:30 +0100)
This leaded to make quic_pto_pktns() return 01RTT packet number space
when initiating a probing even if the handshake was not completed!

include/haproxy/quic_loss.h

index 04b5084bd29b33f0f94b8db9c6ec343c973961a3..6105ceaeb4375a538a753739c943452840e0b97c 100644 (file)
@@ -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));