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.
This commit is contained in:
Willy Tarreau 2019-02-06 10:25:07 +01:00
parent f7679ad4db
commit 1a0fe3becd
2 changed files with 4 additions and 3 deletions

View File

@ -2652,7 +2652,7 @@ int check_config_validity()
else if (curproxy->bind_proc & ~target->bind_proc) { 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", 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); curproxy->id, target->id, curproxy->id);
return 0; cfgerr++;
} }
else { else {
free((void *)mrule->table.name); free((void *)mrule->table.name);
@ -2690,7 +2690,7 @@ int check_config_validity()
else if (curproxy->bind_proc & ~target->bind_proc) { 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", 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); curproxy->id, target->id, curproxy->id);
return 0; cfgerr++;
} }
else { else {
free((void *)mrule->table.name); free((void *)mrule->table.name);

View File

@ -1267,7 +1267,8 @@ int smp_resolve_args(struct proxy *p)
if (p->bind_proc & ~px->bind_proc) { 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", 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); cur->file, cur->line, px->id, p->id);
return 0; cfgerr++;
break;
} }
free(arg->data.str.area); free(arg->data.str.area);