]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Do not modify a marked as consumed datagram
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 2 Feb 2022 08:41:27 +0000 (09:41 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 2 Feb 2022 17:24:21 +0000 (18:24 +0100)
Mark the datagrams as consumed at the very last time.

src/xprt_quic.c

index e1dcd62146707bd452ed485a7f2af5599ce36dcf..0f9987e0266a021045d1a05d3f6de409cce2b8ea 100644 (file)
@@ -5397,14 +5397,14 @@ struct task *quic_lstnr_dghdlr(struct task *t, void *ctx, unsigned int state)
                                break;
                } while (pos < end);
 
-               /* Mark this datagram as consumed */
-               HA_ATOMIC_STORE(&dgram->buf, NULL);
-
                /* Increasing the received bytes counter by the UDP datagram length
                 * if this datagram could be associated to a connection.
                 */
                if (dgram->qc)
                        dgram->qc->rx.bytes += dgram->len;
+
+               /* Mark this datagram as consumed */
+               HA_ATOMIC_STORE(&dgram->buf, NULL);
        }
 
        return t;