BUG/MINOR: http-ana: Only consider dst address to process originalto option
When an except parameter is used for originalto option, only the destination
address must be evaluated. Especially, the address family of the destination
must be tested and not the source one.
This patch must be backported to all stable versions. However be careful,
depending the versions the code may be slightly different.
(cherry picked from commit cccded98c7b3f2281fe4481895b1392e78cc5df0)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit df82f0b02a556f15cb4550851699828f5b11a6bf)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 5d7f40b92414f159c0ef28627a482df30be4e8ed)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit d1323b6e999f74dea8a1187091987de69c78aca5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/proto_htx.c b/src/proto_htx.c
index c006009..7b913c5 100644
--- a/src/proto_htx.c
+++ b/src/proto_htx.c
@@ -899,7 +899,7 @@
if ((sess->fe->options | s->be->options) & PR_O_ORGTO) {
/* FIXME: don't know if IPv6 can handle that case too. */
- if (cli_conn && cli_conn->addr.from.ss_family == AF_INET) {
+ if (cli_conn && cli_conn->addr.to.ss_family == AF_INET) {
/* Add an X-Original-To header unless the destination IP is
* in the 'except' network range.
*/