]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Too big PTO during handshakes
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 26 Jan 2023 14:18:17 +0000 (15:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 3 Feb 2023 16:55:55 +0000 (17:55 +0100)
During the handshake and when the handshake has not been confirmed
the acknowledgement delays reported by the peer may be larger
than max_ack_delay. max_ack_delay SHOULD be ignored before the
handshake is completed when computing the PTO. But the current code considered
the wrong condition "before the hanshake is completed".

Replace the enum value QUIC_HS_ST_COMPLETED by QUIC_HS_ST_CONFIRMED to
fix this issue. In quic_loss.c, the parameter passed to quic_pto_pktns()
is renamed to avoid any possible confusion.

Must be backported to 2.7 and 2.6.

src/quic_conn.c
src/quic_loss.c

index 8fa28ba2fafbe0a45141496b57ec542a563fa3ee..f0935f2103f6f77ed67335b4366e9891d0720a90 100644 (file)
@@ -734,7 +734,7 @@ static inline void qc_set_timer(struct quic_conn *qc)
 {
        struct quic_pktns *pktns;
        unsigned int pto;
-       int handshake_complete;
+       int handshake_confirmed;
 
        TRACE_ENTER(QUIC_EV_CONN_STIMER, qc,
                    NULL, NULL, &qc->path->ifae_pkts);
@@ -762,8 +762,8 @@ static inline void qc_set_timer(struct quic_conn *qc)
                goto out;
        }
 
-       handshake_complete = qc->state >= QUIC_HS_ST_COMPLETE;
-       pktns = quic_pto_pktns(qc, handshake_complete, &pto);
+       handshake_confirmed = qc->state >= QUIC_HS_ST_CONFIRMED;
+       pktns = quic_pto_pktns(qc, handshake_confirmed, &pto);
        if (tick_isset(pto))
                qc->timer = pto;
  out:
@@ -4650,7 +4650,7 @@ struct task *qc_process_timer(struct task *task, void *ctx, unsigned int state)
        }
 
        if (qc->path->in_flight) {
-               pktns = quic_pto_pktns(qc, qc->state >= QUIC_HS_ST_COMPLETE, NULL);
+               pktns = quic_pto_pktns(qc, qc->state >= QUIC_HS_ST_CONFIRMED, NULL);
                if (qc->subs && qc->subs->events & SUB_RETRY_SEND) {
                        pktns->tx.pto_probe = QUIC_MAX_NB_PTO_DGRAMS;
                        tasklet_wakeup(qc->subs->tasklet);
index 0c7c3a1d9be00ee4640c15afc387c5fb71e9c3fb..a92b69942f31bcf38bbabb3996c9dcfad1332958 100644 (file)
@@ -80,7 +80,7 @@ struct quic_pktns *quic_loss_pktns(struct quic_conn *qc)
  * as PTO value if not.
  */
 struct quic_pktns *quic_pto_pktns(struct quic_conn *qc,
-                                  int handshake_completed,
+                                  int handshake_confirmed,
                                   unsigned int *pto)
 {
        int i;
@@ -117,7 +117,7 @@ struct quic_pktns *quic_pto_pktns(struct quic_conn *qc,
                        continue;
 
                if (i == QUIC_TLS_PKTNS_01RTT) {
-                       if (!handshake_completed) {
+                       if (!handshake_confirmed) {
                                TRACE_STATE("handshake not already completed", QUIC_EV_CONN_SPTO, qc);
                                pktns = p;
                                goto out;