]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: config: "source" does not work in defaults section
authorGodbach <nylzhaowei@gmail.com>
Tue, 23 Apr 2013 07:27:57 +0000 (15:27 +0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Apr 2013 06:41:16 +0000 (08:41 +0200)
commit9f04853bd9231bddda2dbde03dae5be21d9b99a9
tree0e3357878da01c2162e9c97b446764b677dfb3cc
parent7f6fa69221c41a3cf81c4f1bcba45792baaba7d7
BUG/MINOR: config: "source" does not work in defaults section

Source function will not work with the following line in default section:
     source 0.0.0.0 usesrc clientip
even that related settings by iptables and ip rule have been set correctly.
But it can work well in backend setcion.

The reason is that the operation in line 1815 in cfgparse.c as below:
     curproxy->conn_src.opts = defproxy.conn_src.opts & ~CO_SRC_TPROXY_MASK;

clears three low bits of conn_src.opts which stores the configuration of
'usesrc'. Without correct bits set, the source address function can not
work well. They should be copied to the backend proxy without being modified.

Since conn_src.tproxy_addr had not copied from defproxy to backend proxy
while initializing backend proxy, source function will not work well
with explicit source address set in default section either.

Signed-off-by: Godbach <nylzhaowei@gmail.com>
Note: the bug was introduced in 1.5-dev16 with commit ef9a3605
src/cfgparse.c