]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: PTO timer too often reset
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 4 Jan 2022 15:59:42 +0000 (16:59 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 4 Jan 2022 16:30:00 +0000 (17:30 +0100)
It must be reset when the anti-amplication was reached but only if the
peer address was not validated.

src/xprt_quic.c

index 7b371fd63507b1840bb5385ec6e61ea205468b64..b4dca7533bf4a58d5737fa4d51ac28866de1d30c 100644 (file)
@@ -621,7 +621,8 @@ static inline void qc_set_timer(struct quic_conn *qc)
        /* anti-amplification: the timer must be
         * cancelled for a server which reached the anti-amplification limit.
         */
-       if (qc->flags & QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED) {
+       if (!quic_peer_validated_addr(qc) &&
+           (HA_ATOMIC_LOAD(&qc->flags) & QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED)) {
                TRACE_PROTO("anti-amplification reached", QUIC_EV_CONN_STIMER, qc);
                qc->timer = TICK_ETERNITY;
                goto out;