]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Missing check when setting the anti-amplification limit as reached
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 10 Mar 2022 09:38:20 +0000 (10:38 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 11 Mar 2022 10:37:30 +0000 (11:37 +0100)
Ensure the peer address is not validated before setting the anti-amplication
limit as reached.

src/xprt_quic.c

index bb35f70405636c4eebaa236e47befdf936afe797..15b7ddd2f5803dd56c53cb4847d4bfec21d3fd51 100644 (file)
@@ -5193,7 +5193,7 @@ static struct quic_tx_packet *qc_build_pkt(unsigned char **pos,
        /* Consume a packet number */
        qel->pktns->tx.next_pn++;
        qc->tx.prep_bytes += pkt->len;
-       if (qc->tx.prep_bytes >= 3 * qc->rx.bytes)
+       if (qc->tx.prep_bytes >= 3 * qc->rx.bytes && !quic_peer_validated_addr(qc))
                HA_ATOMIC_OR(&qc->flags, QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED);
        /* Now that a correct packet is built, let us consume <*pos> buffer. */
        *pos = end;