From: Amaury Denoyelle Date: Fri, 2 Oct 2026 07:25:13 +0000 (+0200) Subject: BUG/MINOR: proxy: add PR_CAP_LB for dynamically added backend X-Git-Tag: v3.5-dev9~229 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=2de728173d658c98ca031ece62a0021c5dd93840;p=haproxy.git BUG/MINOR: proxy: add PR_CAP_LB for dynamically added backend When a new backend is added at runtime via the CLI, ensures its cap contains PR_CAP_LB along with already set PR_CAP_BE. The purpose of this cap is to flag a proxy with "load-balancing capabilities". In fact this is a loose meaning which could be understand in several manners. Currently, this cap is reserved for frontend, backend and listen instances from the configuration file explicitely created by users, by contrast to internal proxies. Thus, dynamically added backends also enter in this definition. The impact of this bug is limited as PR_CAP_LB usage is only used for checking the compatibility of a server with the proxy mode. However, this may change in the future so this change is mandatory. This must be backported up to 3.4. --- diff --git a/src/proxy.c b/src/proxy.c index d50da98fa..37785a1c5 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -5052,7 +5052,7 @@ static int cli_parse_add_backend(char **args, char *payload, struct appctx *appc goto err; } - px = alloc_new_proxy(be_name, PR_CAP_BE, &msg); + px = alloc_new_proxy(be_name, PR_CAP_BE|PR_CAP_LB, &msg); if (!px) goto err;