]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: quic: quic_cc_conn ->cntrs counters unreachable
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 12 Sep 2023 09:51:57 +0000 (11:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 12 Sep 2023 16:13:36 +0000 (18:13 +0200)
This bug arrived with this commit in 2.9-dev3:

    MEDIUM: quic: Allow the quic_conn memory to be asap released.

When sending packets from quic_cc_conn_io_cb(), e.g. when the quic_conn
object has been released and replaced by a lighter one (quic_cc_conn),
some counters may have to be incremented. But they were not reachable
because not shared between quic_conn and quic_cc_conn struct.

To fix this, one has only to move the ->cntrs counters from quic_conn
to QUIC_CONN_COMMON struct which is shared between both quic_cc_conn

Thank you to Tristan for having reported this in GH #2247.

No need to backport.

include/haproxy/quic_conn-t.h

index 92d1323cad2b4307d368c006ecb077a3f7f330fa..5373d42f722bfbb5761389af9bb517a202d3bfb2 100644 (file)
@@ -499,6 +499,8 @@ struct quic_conn_cntrs {
         /* Used only to reach the tasklet for the I/O handler from this        \
          * quic_conn object.                                                   \
          */                                                                    \
+        /* QUIC connection level counters */                                   \
+        struct quic_conn_cntrs cntrs;                                          \
         struct connection *conn;                                               \
     }
 
@@ -584,8 +586,6 @@ struct quic_conn {
        unsigned int ack_expire;
 
        const struct qcc_app_ops *app_ops;
-       /* QUIC connection level counters */
-       struct quic_conn_cntrs cntrs;
        /* Proxy counters */
        struct quic_counters *prx_counters;