MINOR: quic: Add a BUG_ON() on quic_tx_packet refcount
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 21 Jan 2025 15:12:05 +0000 (16:12 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Jan 2025 10:21:25 +0000 (11:21 +0100)
commit1264b812bc10699d912d3bedcc73b0a1ac059cf0
treee09f0e554f4cc383bafc6cd7b6299811f5b27757
parentd3eb23c684269d22a5d9059b38018c76c4926c3b
MINOR: quic: Add a BUG_ON() on quic_tx_packet refcount

This is definitively a bug to call quic_tx_packet_refdec() to decrement the reference
counter of a TX packet calling quic_tx_packet_refdec(), and possibly to release its
memory when it is negative or null.

This counter is incremented when a TX frm is attached to it with some allocated memory
and when the packet is inserted into a data structure, if needed (list or tree).

Should be easily backported as far as 2.6 to ease any further backport around
this code part.

(cherry picked from commit 4f38c4bfd8c07331258b4b13111a07c7b3013021)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/quic_tx.h