]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config: make sure to count the error on incorrect track-sc/stick rules
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Feb 2019 09:25:07 +0000 (10:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Feb 2019 09:25:07 +0000 (10:25 +0100)
When commit 151e1ca98 ("BUG/MAJOR: config: verify that targets of track-sc
and stick rules are present") added a check for some process inconsistencies
between rules and their stick tables, some errors resulted in a "return 0"
statement, which is taken as "no error" in some cases. Let's fix this.

This must be backported to all versions using the above commit.

src/cfgparse.c
src/sample.c

index a51771d44f3adeb54893c4fcfc117a8755172b25..3ed58f39306cacb9be2eb515a06ffb9974c86ca5 100644 (file)
@@ -2652,7 +2652,7 @@ int check_config_validity()
                        else if (curproxy->bind_proc & ~target->bind_proc) {
                                ha_alert("Proxy '%s': stick-table '%s' referenced 'stick-store' rule not present on all processes covered by proxy '%s'.\n",
                                         curproxy->id, target->id, curproxy->id);
-                               return 0;
+                               cfgerr++;
                        }
                        else {
                                free((void *)mrule->table.name);
@@ -2690,7 +2690,7 @@ int check_config_validity()
                        else if (curproxy->bind_proc & ~target->bind_proc) {
                                ha_alert("Proxy '%s': stick-table '%s' referenced 'stick-store' rule not present on all processes covered by proxy '%s'.\n",
                                         curproxy->id, target->id, curproxy->id);
-                               return 0;
+                               cfgerr++;
                        }
                        else {
                                free((void *)mrule->table.name);
index 963cb597d2512b253d478154b10d4dd35eb09d54..16251f0061e7a59a8e78f18fb504d4815bf9654c 100644 (file)
@@ -1267,7 +1267,8 @@ int smp_resolve_args(struct proxy *p)
                        if (p->bind_proc & ~px->bind_proc) {
                                ha_alert("parsing [%s:%d] : stick-table '%s' not present on all processes covered by proxy '%s'.\n",
                                         cur->file, cur->line, px->id, p->id);
-                               return 0;
+                               cfgerr++;
+                               break;
                        }
 
                        free(arg->data.str.area);