MINOR: quic: Replace the RX list of packet by a thread safety one.
This list is shared between the I/O dgram handler and the task responsible
for processing the QUIC packets.
diff --git a/src/proto_quic.c b/src/proto_quic.c
index 1cac5ab..3b66ff9 100644
--- a/src/proto_quic.c
+++ b/src/proto_quic.c
@@ -514,7 +514,7 @@
*/
static void quic_add_listener(struct protocol *proto, struct listener *listener)
{
- LIST_INIT(&listener->rx.qpkts);
+ MT_LIST_INIT(&listener->rx.pkts);
listener->rx.odcids = EB_ROOT_UNIQUE;
listener->rx.cids = EB_ROOT_UNIQUE;
default_add_listener(proto, listener);
diff --git a/src/quic_sock.c b/src/quic_sock.c
index 042c35d..a2c4bec 100644
--- a/src/quic_sock.c
+++ b/src/quic_sock.c
@@ -145,13 +145,12 @@
int ret;
qc = NULL;
- pkt = LIST_ELEM(l->rx.qpkts.n, struct quic_rx_packet *, rx_list);
+ pkt = MT_LIST_POP(&l->rx.pkts, struct quic_rx_packet *, rx_list);
/* Should never happen. */
- if (&pkt->rx_list == &l->rx.qpkts)
+ if (!pkt)
goto err;
qc = pkt->qc;
- LIST_DELETE(&pkt->rx_list);
if (!new_quic_cli_conn(qc, l, &pkt->saddr))
goto err;
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 6a0f9bf..cb052b4 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -3399,7 +3399,7 @@
}
else if (!found_conn) {
/* Enqueue this packet. */
- LIST_APPEND(&l->rx.qpkts, &pkt->rx_list);
+ MT_LIST_APPEND(&l->rx.pkts, &pkt->rx_list);
/* Try to accept a new connection. */
listener_accept(l);
}