]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: remove access to CID global tree outside of quic_cid module
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 27 Jun 2024 16:08:54 +0000 (18:08 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 3 Jul 2024 13:02:40 +0000 (15:02 +0200)
commit0a352ef08e6b9c2cd1454c4930ab4bbbf7df874f
tree1134a53b6a5eb7548951bd6a5662febf7c050b89
parent5d186673df09b35d23b647242d8b838037520b0b
MINOR: quic: remove access to CID global tree outside of quic_cid module

haproxy generates for each QUIC connection a set of CID. The peer must
reuse them as DCID for its emitted packet. On datagram reception, DCID
field serves as identifier to dispatch them on their correct thread.

These CIDs are stored in a global CID tree. Access to this data
structure must always be protected with CID_LOCK. This commit is a
refactoring to regroup all CID tree access in quic_cid module. Several
code parts are ajusted :

* quic_cid_insert() is extended to check for insertion race-condition.
  This is useful on quic_conn instantiation. Code where such race cannot
  happen can use unsafe _quic_cid_insert() instead.

* on RETIRE_CONNECTION_ID frame reception, existing quic_cid_delete()
  function is used.

* remove tree lookup from qc_check_dcid(), extracted in the new
  quic_cmp_cid_conn() function. Ultimately, the latter should be removed
  as CID lookup could be conducted on quic_conn owned tree without
  locking.
include/haproxy/quic_cid.h
src/quic_cid.c
src/quic_conn.c
src/quic_rx.c