mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-28 16:40:37 +00:00
MINOR: quic: add missing lock on cid tree
All operation on the ODCID/DCID trees must be conducted under a read-write lock. Add a missing read-lock on the lookup operation inside listener handler.
This commit is contained in:
parent
67e6cd50ef
commit
260e5e6c24
@ -4115,14 +4115,19 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char **buf, const unsigned char *end,
|
||||
}
|
||||
|
||||
cids = &l->rx.cids;
|
||||
|
||||
HA_RWLOCK_RDLOCK(QUIC_LOCK, &l->rx.cids_lock);
|
||||
node = ebmb_lookup(cids, *buf, QUIC_CID_LEN);
|
||||
if (!node) {
|
||||
HA_RWLOCK_RDUNLOCK(QUIC_LOCK, &l->rx.cids_lock);
|
||||
TRACE_PROTO("Packet dropped", QUIC_EV_CONN_LPKT);
|
||||
goto err;
|
||||
}
|
||||
|
||||
cid = ebmb_entry(node, struct quic_connection_id, node);
|
||||
qc = cid->qc;
|
||||
HA_RWLOCK_RDUNLOCK(QUIC_LOCK, &l->rx.cids_lock);
|
||||
|
||||
if (HA_ATOMIC_LOAD(&qc->conn))
|
||||
conn_ctx = HA_ATOMIC_LOAD(&qc->conn->xprt_ctx);
|
||||
*buf += QUIC_CID_LEN;
|
||||
|
Loading…
Reference in New Issue
Block a user