]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: quic: fix unused variable warning when threads are disabled
authorWilly Tarreau <w@1wt.eu>
Fri, 24 May 2024 09:04:30 +0000 (11:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 May 2024 09:51:41 +0000 (11:51 +0200)
The tree variable was introduced in 3.0 by commit dd58dff1e6
("BUG/MEDIUM: quic: QUIC CID removed from tree without locking") which
was marked for backport. The variable is only used for locks.
Let's just mark the variable __maybe_unused for when the code is
built without threads.

The patch above was marked for backport to 2.7 so this should be
backported wherever the fix was backported.

src/quic_rx.c

index 3645f1673d43f7295aca182e6dc41eb26b4c71fd..f530c443b0b727af70a6c5a66493e02ba9228475 100644 (file)
@@ -982,7 +982,7 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt,
                        break;
                case QUIC_FT_RETIRE_CONNECTION_ID:
                {
-                       struct quic_cid_tree *tree;
+                       struct quic_cid_tree *tree __maybe_unused;
                        struct quic_connection_id *conn_id = NULL;
 
                        if (!qc_handle_retire_connection_id_frm(qc, &frm, &pkt->dcid, &conn_id))