mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
MINOR: quic: Do not allocate too much ack ranges
Limit the maximum number of ack ranges to QUIC_MAX_ACK_RANGES(32). Must be backported to 2.6 and 2.7.
This commit is contained in:
parent
4b2627beae
commit
0ed94032b2
@ -321,6 +321,9 @@ struct quic_arng_node {
|
|||||||
uint64_t last;
|
uint64_t last;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* The maximum number of ack ranges to be built in ACK frames */
|
||||||
|
#define QUIC_MAX_ACK_RANGES 32
|
||||||
|
|
||||||
/* Structure to maintain a set of ACK ranges to be used to build ACK frames. */
|
/* Structure to maintain a set of ACK ranges to be used to build ACK frames. */
|
||||||
struct quic_arngs {
|
struct quic_arngs {
|
||||||
/* ebtree of ACK ranges organized by their first value. */
|
/* ebtree of ACK ranges organized by their first value. */
|
||||||
|
@ -4246,6 +4246,16 @@ struct quic_arng_node *quic_insert_new_range(struct quic_conn *qc,
|
|||||||
|
|
||||||
TRACE_ENTER(QUIC_EV_CONN_RXPKT, qc);
|
TRACE_ENTER(QUIC_EV_CONN_RXPKT, qc);
|
||||||
|
|
||||||
|
if (arngs->sz >= QUIC_MAX_ACK_RANGES) {
|
||||||
|
struct eb64_node *last;
|
||||||
|
|
||||||
|
last = eb64_last(&arngs->root);
|
||||||
|
BUG_ON(last == NULL);
|
||||||
|
eb64_delete(last);
|
||||||
|
pool_free(pool_head_quic_arng, last);
|
||||||
|
arngs->sz--;
|
||||||
|
}
|
||||||
|
|
||||||
new_ar = pool_alloc(pool_head_quic_arng);
|
new_ar = pool_alloc(pool_head_quic_arng);
|
||||||
if (!new_ar) {
|
if (!new_ar) {
|
||||||
TRACE_ERROR("ack range allocation failed", QUIC_EV_CONN_RXPKT, qc);
|
TRACE_ERROR("ack range allocation failed", QUIC_EV_CONN_RXPKT, qc);
|
||||||
|
Loading…
Reference in New Issue
Block a user