]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cfgparse-listen: fix warning being reported as an alert
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 29 Nov 2023 14:03:25 +0000 (15:03 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 1 Dec 2023 08:09:45 +0000 (09:09 +0100)
Since b40542000d ("MEDIUM: proxy: Warn about ambiguous use of named
defaults sections") we introduced a new error to prevent user from
having an ambiguous named default section in the config which is both
inherited explicitly using "from" and implicitly by another proxy due to
the default section being the last one defined.

However, despite the error message being presented as a warning the
err_code, the commit message and the documentation, it is actually
reported as a fatal error because ha_alert() was used in place of
ha_warning().

In this patch we make the code comply with the documentation and the
intended behavior by using ha_warning() to report the error message.

This should be backported up to 2.6.

src/cfgparse-listen.c

index a8379e4efb8458206f7ba61c0cdcbfb5a183bc62..4f88b77d65bc3172f5b04e3264f1d4cb643a051f 100644 (file)
@@ -321,9 +321,9 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        curr_defproxy->flags |= PR_FL_IMPLICIT_REF;
 
                if (curr_defproxy && (curr_defproxy->flags & (PR_FL_EXPLICIT_REF|PR_FL_IMPLICIT_REF)) == (PR_FL_EXPLICIT_REF|PR_FL_IMPLICIT_REF)) {
-                       ha_alert("parsing [%s:%d] : defaults section '%s' (declared at %s:%d) is explicitly referenced by another proxy and implicitly used here."
-                                " To avoid any ambiguity don't mix both usage. Add a last defaults section not explicitly used or always use explicit references.\n",
-                                file, linenum, curr_defproxy->id, curr_defproxy->conf.file, curr_defproxy->conf.line);
+                       ha_warning("parsing [%s:%d] : defaults section '%s' (declared at %s:%d) is explicitly referenced by another proxy and implicitly used here."
+                                  " To avoid any ambiguity don't mix both usage. Add a last defaults section not explicitly used or always use explicit references.\n",
+                                  file, linenum, curr_defproxy->id, curr_defproxy->conf.file, curr_defproxy->conf.line);
                        err_code |= ERR_WARN;
                }