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:33:15 +0000 (11:33 +0100)
commita7d5e46cb7b7effd66300ccbf333619b690227cb
treedd287e2e2dab86827ef1a55651fc353c7e095587
parente9ee3ffed01823ee1724b223f14dae4383db72e3
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>
(cherry picked from commit 1264b812bc10699d912d3bedcc73b0a1ac059cf0)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/quic_tx.h