summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2009-03-01 08:27:21 +0100
committerWilly Tarreau <w@1wt.eu>2009-03-08 23:34:30 +0100
commitbf8768f3453d21ed9cd24cd5526ff87ce73fa62a (patch)
tree50fe45289ac12a5d04e4f24308740adedc1147e7
parent47773d51aec5f9abd360980c36c8a17cc980ded2 (diff)
downloadhaproxy-bf8768f3453d21ed9cd24cd5526ff87ce73fa62a.tar.gz
[BUG] the "source" keyword must first clear optional settings
Problem reported by John Lauro. When "source ... usesrc ..." is set in the defaults section, it is not possible anymore to remove the "usesrc" part when declaring a more precise "source" in a backend. The only workaround was to declare it by server. We need to clear optional settings when declaring a new "source". (cherry picked from commit 368480cf4570a0d6448741c704aebd53ac467aa9) (cherry picked from commit 15b939fbdd5885b6814454c273e64b8cd348b59d)
-rw-r--r--src/cfgparse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 7544f895d..e9a3320e2 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1789,7 +1789,10 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv)
#endif
return -1;
}
-
+
+ /* we must first clear any optional default setting */
+ curproxy->options &= ~PR_O_TPXY_MASK;
+
curproxy->source_addr = *str2sa(args[1]);
curproxy->options |= PR_O_BIND_SRC;
if (!strcmp(args[2], "usesrc")) { /* address to use outside */