]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config: disable http-reuse on TCP proxies
authorWilly Tarreau <w@1wt.eu>
Sat, 28 Apr 2018 05:18:15 +0000 (07:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 28 Apr 2018 05:18:15 +0000 (07:18 +0200)
Louis Chanouha reported an inappropriate warning when http-reuse is
present in a defaults section while a TCP proxy accidently inherits
it and finds a conflict with other options like the use of the PROXY
protocol. To fix this patch removes the http-reuse option for TCP
proxies.

This fix needs to be backported to 1.8, 1.7 and possibly 1.6.

src/cfgparse.c

index 621af6c814268e127aa9ee36963d12b15a52144c..76535360ff21f1c2966731e86f3aac50df61e46a 100644 (file)
@@ -8507,6 +8507,9 @@ out_uri_auth_compat:
                        }
 #endif
 
+                       if ((curproxy->mode != PR_MODE_HTTP) && (curproxy->options & PR_O_REUSE_MASK) != PR_O_REUSE_NEVR)
+                               curproxy->options &= ~PR_O_REUSE_MASK;
+
                        if ((curproxy->options & PR_O_REUSE_MASK) != PR_O_REUSE_NEVR) {
                                if ((curproxy->conn_src.opts & CO_SRC_TPROXY_MASK) == CO_SRC_TPROXY_CLI ||
                                    (curproxy->conn_src.opts & CO_SRC_TPROXY_MASK) == CO_SRC_TPROXY_CIP ||