]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config: don't inherit the default balance algorithm in frontends
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Nov 2014 14:04:29 +0000 (15:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Nov 2014 14:04:29 +0000 (15:04 +0100)
Tom Limoncelli from Stack Exchange reported a minor bug : the frontend
inherits the LB parameters from the defaults sections. The impact is
that if a "balance" directive uses any L7 parameter in the defaults
sections and the frontend is in TCP mode, a warning is emitted about
their incompatibility. The warning is harmless but a valid, sane config
should never cause any warning to be reported.

This fix should be backported into 1.5 and possibly 1.4.

src/cfgparse.c

index 09a0fd3d777671be64e0cbadd88d29b980c013d3..a6a00517d0451c0e65200611e553b298ec952c9c 100644 (file)
@@ -2006,7 +2006,6 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                curproxy->no_options = defproxy.no_options;
                curproxy->no_options2 = defproxy.no_options2;
                curproxy->bind_proc = defproxy.bind_proc;
-               curproxy->lbprm.algo = defproxy.lbprm.algo;
                curproxy->except_net = defproxy.except_net;
                curproxy->except_mask = defproxy.except_mask;
                curproxy->except_to = defproxy.except_to;
@@ -2040,6 +2039,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                }
 
                if (curproxy->cap & PR_CAP_BE) {
+                       curproxy->lbprm.algo = defproxy.lbprm.algo;
                        curproxy->fullconn = defproxy.fullconn;
                        curproxy->conn_retries = defproxy.conn_retries;
                        curproxy->max_ka_queue = defproxy.max_ka_queue;