]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: warn when tcp-check rules are used without option tcp-check
authorWilly Tarreau <w@1wt.eu>
Fri, 13 Jun 2014 16:30:23 +0000 (18:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 13 Jun 2014 16:30:23 +0000 (18:30 +0200)
Since this case means that the rules will be ignored, better emit a warning.

src/cfgparse.c

index 00b75828d9d71aded962cf319dc628aaca4d01c5..017bcae029ce17c381cac2c0d2fe2cb3fcb508ee 100644 (file)
@@ -6504,6 +6504,13 @@ out_uri_auth_compat:
                        memcpy(curproxy->check_req, sslv3_client_hello_pkt, curproxy->check_len);
                }
 
+               if (!LIST_ISEMPTY(&curproxy->tcpcheck_rules) &&
+                   (curproxy->options2 & PR_O2_CHK_ANY) != PR_O2_TCPCHK_CHK) {
+                       Warning("config : %s '%s' uses tcp-check rules without 'option tcp-check', so the rules are ignored.\n",
+                               proxy_type_str(curproxy), curproxy->id);
+                       err_code |= ERR_WARN;
+               }
+
                /* ensure that cookie capture length is not too large */
                if (curproxy->capture_len >= global.tune.cookie_len) {
                        Warning("config : truncating capture length to %d bytes for %s '%s'.\n",