mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-24 07:37:53 -04:00
MINOR: tcp-rules: Kill connections when custom actions return ACT_RET_ERR
Thanks to the commit "MINOR: actions: Use ACT_RET_CONT code to ignore an error from a custom action", it is now possible to trigger an error from a custom action in tcp-content rules. Now, when a custom action returns the ACT_RET_ERR code, it has the same behavior than a reject rules, the connection is killed. Be careful if this patch is backported. The other mentioned patch must be backported first.
This commit is contained in:
parent
13403761d5
commit
491ab5e2e5
1 changed files with 4 additions and 0 deletions
|
|
@ -158,6 +158,7 @@ resume_execution:
|
|||
break;
|
||||
}
|
||||
else if (rule->action == ACT_ACTION_DENY) {
|
||||
deny:
|
||||
si_must_kill_conn(chn_prod(req));
|
||||
channel_abort(req);
|
||||
channel_abort(&s->res);
|
||||
|
|
@ -235,6 +236,7 @@ resume_execution:
|
|||
|
||||
switch (rule->action_ptr(rule, s->be, s->sess, s, act_flags)) {
|
||||
case ACT_RET_ERR:
|
||||
goto deny;
|
||||
case ACT_RET_CONT:
|
||||
continue;
|
||||
case ACT_RET_STOP:
|
||||
|
|
@ -336,6 +338,7 @@ resume_execution:
|
|||
break;
|
||||
}
|
||||
else if (rule->action == ACT_ACTION_DENY) {
|
||||
deny:
|
||||
si_must_kill_conn(chn_prod(rep));
|
||||
channel_abort(rep);
|
||||
channel_abort(&s->req);
|
||||
|
|
@ -370,6 +373,7 @@ resume_execution:
|
|||
|
||||
switch (rule->action_ptr(rule, s->be, s->sess, s, act_flags)) {
|
||||
case ACT_RET_ERR:
|
||||
goto deny;
|
||||
case ACT_RET_CONT:
|
||||
continue;
|
||||
case ACT_RET_STOP:
|
||||
|
|
|
|||
Loading…
Reference in a new issue