MEDIUM: acl: get rid of the SET_RES flags
We now simply rely on a boolean result from a fetch to declare a match.
Booleans are not compared against patterns, they fix the result.
diff --git a/src/acl.c b/src/acl.c
index 91a9754..9c4ce0c 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -69,7 +69,7 @@
struct acl_expr *expr, struct sample *smp)
{
smp->type = SMP_T_BOOL;
- smp->flags |= SMP_F_SET_RES_PASS;
+ smp->data.uint = 1;
return 1;
}
@@ -85,7 +85,7 @@
return 0;
}
smp->type = SMP_T_BOOL;
- smp->flags |= SMP_F_SET_RES_PASS;
+ smp->data.uint = 1;
return 1;
}
@@ -95,7 +95,7 @@
struct acl_expr *expr, struct sample *smp)
{
smp->type = SMP_T_BOOL;
- smp->flags |= SMP_F_SET_RES_FAIL;
+ smp->data.uint = 0;
return 1;
}
@@ -1870,8 +1870,8 @@
continue;
}
- if (smp.flags & SMP_F_RES_SET) {
- if (smp.flags & SMP_F_RES_PASS)
+ if (smp.type == SMP_T_BOOL) {
+ if (smp.data.uint)
acl_res |= ACL_PAT_PASS;
else
acl_res |= ACL_PAT_FAIL;