BUG/MINOR: config: make sure to count the error on incorrect track-sc/stick rules
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.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index a51771d..3ed58f3 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -2652,7 +2652,7 @@
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 @@
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);
diff --git a/src/sample.c b/src/sample.c
index 963cb59..16251f0 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -1267,7 +1267,8 @@
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);