]> git.kaiwu.me - haproxy.git/commitdiff
[BUG] the "source" keyword must first clear optional settings
authorWilly Tarreau <w@1wt.eu>
Sun, 1 Mar 2009 07:27:21 +0000 (08:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 1 Mar 2009 07:30:00 +0000 (08:30 +0100)
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)

src/cfgparse.c

index d09d6da795e1de95b1fdbd29eaac571481c528cb..d01b4754ab218a131ea51a9887116d1e7d2720bc 100644 (file)
@@ -1903,7 +1903,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 */