From 1a0fe3becd99d7860b4eeaccec407325d5a8b8c2 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 6 Feb 2019 10:25:07 +0100 Subject: [PATCH] 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. --- src/cfgparse.c | 4 ++-- src/sample.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index a51771d44..3ed58f393 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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); diff --git a/src/sample.c b/src/sample.c index 963cb597d..16251f006 100644 --- a/src/sample.c +++ b/src/sample.c @@ -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);