]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: rules: Increment be_counters if backend is assigned for a silent-drop
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Mar 2020 14:23:18 +0000 (15:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Mar 2020 14:36:04 +0000 (15:36 +0100)
Backend counters must be incremented only if a backend was already assigned to
the stream (when the stream exists). Otherwise, it means we are still on the
frontend side.

This patch may be backported as far as 1.6.

src/proto_tcp.c

index 74790e8c3963d33bf8430b02592f4e86494e25c3..afcb1bc0af2a02dfd679e193ea2f578f28a9dd31 100644 (file)
@@ -1266,6 +1266,8 @@ static enum act_return tcp_exec_action_silent_drop(struct act_rule *rule, struct
                channel_abort(&strm->res);
                strm->req.analysers &= AN_REQ_FLT_END;
                strm->res.analysers &= AN_RES_FLT_END;
+               if (strm->flags & SF_BE_ASSIGNED)
+                       _HA_ATOMIC_ADD(&strm->be->be_counters.denied_req, 1);
                if (!(strm->flags & SF_ERR_MASK))
                        strm->flags |= SF_ERR_PRXCOND;
                if (!(strm->flags & SF_FINST_MASK))