]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: rules: Be able to use captures defined in defaults section
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 25 Apr 2022 12:30:58 +0000 (14:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 25 Apr 2022 13:28:21 +0000 (15:28 +0200)
commit5796228abad4a0113daaef4be7e42e5234cfa15a
tree5ca48c756cfb74f13f24f4f2cdc81dbea05f119e
parent6c10f5c7bcc4da8c782ec09c200dd485e133c403
BUG/MEDIUM: rules: Be able to use captures defined in defaults section

Since the 2.5, it is possible to define TCP/HTTP ruleset in defaults
sections. However, rules defining a capture in defaults sections was not
properly handled because they was not shared with the proxies inheriting
from the defaults section. This led to crash when haproxy tried to store a
new capture.

So now, to fix the issue, when a new proxy is created, the list of captures
points to the list of its defaults section. It may be NULL or not. All new
caputres are prepended to this list. It is not a problem to share the same
defaults section between several proxies, because it is not altered and we
take care to not release it when corresponding proxies are freed but only
when defaults proxies are freed. To do so, defaults proxies are now
unreferenced at the end of free_proxy() function instead of the beginning.

This patch should fix the issue #1674. It must be backported to 2.5.
reg-tests/http-rules/default_rules.vtc
src/proxy.c