From: Christopher Faulet Date: Tue, 27 Oct 2026 10:14:17 +0000 (+0100) Subject: MINOR: filters: Declare a proxy as using the legacy API before parsing filter directive X-Git-Tag: v3.5-dev10~37 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=8096423cf4d99a7a955af02cd4cdd4094383e704;p=haproxy.git MINOR: filters: Declare a proxy as using the legacy API before parsing filter directive The "filter" directive declares a legacy filter configuration on the proxy being parsed, which selects the legacy filter mode: the PR_FL_FILTER_LEGACY flag is set on the proxy. Until now the flag was set at the end of the parsing, after the filter keyword was resolved and its configuration produced. The filter keyword parsers may call flt_find_conf() to resolve a previously declared configuration, or may add an implicit instance with flt_add_implicit_instance(). Both rely on the filter mode of the proxy to walk the right configuration list: without the flag they would inspect the filter instances instead of the legacy filter configurations. The keyword parser of a filter is called while the directive is being parsed, so the mode must be known before, not after. The flag is now set as soon as the "filter" directive is identified, so the keyword parsers always see the mode their own directive selects. --- diff --git a/src/filters.c b/src/filters.c index 36f6c1415..c9e453719 100644 --- a/src/filters.c +++ b/src/filters.c @@ -517,6 +517,7 @@ parse_filter(char **args, int section_type, struct proxy *curpx, struct flt_kw *kw; int cur_arg; + curpx->flags |= PR_FL_FILTER_LEGACY; if (!*args[1]) { memprintf(err, "parsing [%s:%d] : missing argument for '%s' in %s '%s'.", @@ -567,7 +568,6 @@ parse_filter(char **args, int section_type, struct proxy *curpx, goto error; } - curpx->flags |= PR_FL_FILTER_LEGACY; fconf->flags |= FLT_CFG_FL_EXPLICIT; flt_conf_add(curpx, fconf); }