]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: fd: Add BUG_ON checks on fd_insert()
authorEmeric Brun <ebrun@haproxy.com>
Fri, 1 Jul 2022 11:57:39 +0000 (04:57 -0700)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Jul 2022 03:18:51 +0000 (05:18 +0200)
commit36d9097cf3cc7ecace0b650db66055c606cd67e0
tree813ad68eed3160924633b073cbcacc363940683a
parent34aae2fd1293872345056a32dec8047a67c3d852
MINOR: fd: Add BUG_ON checks on fd_insert()

This patch adds two BUG_ON on fd_insert() into the fdtab checking
if the fd has been correctly re-initialized into the fdtab
before a new insert.

It will raise a BUG if we try to insert the same fd multiple times
without an intermediate fd_delete().

First one checks that the owner for this fd in fdtab was reset to NULL.

Second one checks that the state flags for this fd in fdtab was reset
to 0.

This patch could be backported on version >= 2.4
include/haproxy/fd.h