mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-15 16:04:37 +00:00
MINOR: tcp-rules: check that the listener exists before updating its counters
The tcp rules may be applied to a TCP stream initiated by applets (spoe, lua, peers, later H2). These ones do not necessarily have a valid listener so we must verify the field is not null before updating the stats. For now there's no way to trigger this bug because lua and peers don't have analysers, h2 is not implemented and spoe has a dummy listener. But this threatens to break at any instant.
This commit is contained in:
parent
0ff98a4758
commit
a12dde04e0
@ -168,7 +168,7 @@ resume_execution:
|
||||
|
||||
s->be->be_counters.denied_req++;
|
||||
sess->fe->fe_counters.denied_req++;
|
||||
if (sess->listener->counters)
|
||||
if (sess->listener && sess->listener->counters)
|
||||
sess->listener->counters->denied_req++;
|
||||
|
||||
if (!(s->flags & SF_ERR_MASK))
|
||||
@ -346,7 +346,7 @@ resume_execution:
|
||||
|
||||
s->be->be_counters.denied_resp++;
|
||||
sess->fe->fe_counters.denied_resp++;
|
||||
if (sess->listener->counters)
|
||||
if (sess->listener && sess->listener->counters)
|
||||
sess->listener->counters->denied_resp++;
|
||||
|
||||
if (!(s->flags & SF_ERR_MASK))
|
||||
@ -428,7 +428,7 @@ int tcp_exec_l4_rules(struct session *sess)
|
||||
}
|
||||
else if (rule->action == ACT_ACTION_DENY) {
|
||||
sess->fe->fe_counters.denied_conn++;
|
||||
if (sess->listener->counters)
|
||||
if (sess->listener && sess->listener->counters)
|
||||
sess->listener->counters->denied_conn++;
|
||||
|
||||
result = 0;
|
||||
@ -515,7 +515,7 @@ int tcp_exec_l5_rules(struct session *sess)
|
||||
}
|
||||
else if (rule->action == ACT_ACTION_DENY) {
|
||||
sess->fe->fe_counters.denied_sess++;
|
||||
if (sess->listener->counters)
|
||||
if (sess->listener && sess->listener->counters)
|
||||
sess->listener->counters->denied_sess++;
|
||||
|
||||
result = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user