mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-06 19:38:22 +00:00
MINOR: quic: Delete remaining RX handshake packets
After the handshake has succeeded, we must delete any remaining Initial or Handshake packets from the RX buffer. This cannot be done depending on the state the connection (->st quic_conn struct member value) as the packet are not received/treated in order.
This commit is contained in:
parent
7d807c93f4
commit
fee7ba673f
@ -1108,6 +1108,24 @@ static inline void quic_tx_packet_refdec(struct quic_tx_packet *pkt)
|
||||
pool_free(pool_head_quic_tx_packet, pkt);
|
||||
}
|
||||
|
||||
/* Delete all RX packets for <qel> QUIC encryption level */
|
||||
static inline void qc_el_rx_pkts_del(struct quic_enc_level *qel)
|
||||
{
|
||||
struct eb64_node *node;
|
||||
|
||||
HA_RWLOCK_WRLOCK(QUIC_LOCK, &qel->rx.pkts_rwlock);
|
||||
node = eb64_first(&qel->rx.pkts);
|
||||
while (node) {
|
||||
struct quic_rx_packet *pkt =
|
||||
eb64_entry(&node->node, struct quic_rx_packet, pn_node);
|
||||
|
||||
node = eb64_next(node);
|
||||
eb64_delete(&pkt->pn_node);
|
||||
quic_rx_packet_refdec(pkt);
|
||||
}
|
||||
HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &qel->rx.pkts_rwlock);
|
||||
}
|
||||
|
||||
void quic_set_tls_alert(struct quic_conn *qc, int alert);
|
||||
ssize_t quic_lstnr_dgram_read(struct buffer *buf, size_t len, void *owner,
|
||||
struct sockaddr_storage *saddr);
|
||||
|
@ -3114,6 +3114,9 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
|
||||
qc_set_timer(ctx);
|
||||
if (!quic_build_post_handshake_frames(qc))
|
||||
goto err;
|
||||
|
||||
qc_el_rx_pkts_del(&qc->els[QUIC_TLS_ENC_LEVEL_INITIAL]);
|
||||
qc_el_rx_pkts_del(&qc->els[QUIC_TLS_ENC_LEVEL_HANDSHAKE]);
|
||||
goto start;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user