]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: Forbid tcp-check lines in default section as documented
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 6 Apr 2020 05:49:19 +0000 (07:49 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 07:39:37 +0000 (09:39 +0200)
src/cfgparse-listen.c

index fbefdd5aa2fbbd9f4d68ca8b3a921d44c30f1f04..4117ea9b689e1cd7128d6239c409178e1c09c52f 100644 (file)
@@ -3019,6 +3019,13 @@ stats_error_parsing:
                if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
                        err_code |= ERR_WARN;
 
+               if (curproxy == &defproxy) {
+                       ha_alert("parsing [%s:%d]: '%s' not allowed in 'defaults' section.\n",
+                                file, linenum, args[0]);
+                       err_code |= ERR_ALERT | ERR_FATAL;
+                       goto out;
+               }
+
                if (strcmp(args[1], "comment") == 0) {
                        int cur_arg;
                        struct tcpcheck_rule *tcpcheck;