summaryrefslogtreecommitdiffstats
path: root/src/plugins/acl/public_inlines.h
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2019-03-20 11:11:19 +0100
committerDamjan Marion <dmarion@me.com>2019-03-22 17:33:09 +0000
commitb5395729c7b08c88f2e520c06b0edec28d3a1fe1 (patch)
tree8eaa6ef43d59bebd649351295bdf11224b26dac1 /src/plugins/acl/public_inlines.h
parent063dfa1587a58319fac139eab5e655ad1c555e33 (diff)
acl-plugin: get rid of a separate "count" field in the linear acl struct
Long time ago, the linear array of rules in the ACL structure was not a vector. Now it is, so get rid of the extraneous "count" member. Do so in a manner that would ease potential the MP-safe manipulation of ACL rules in the future. Change-Id: Ib9c0731e4f21723c9ec4d7f00c3e5ead8e1e97bd Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins/acl/public_inlines.h')
-rw-r--r--src/plugins/acl/public_inlines.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/acl/public_inlines.h b/src/plugins/acl/public_inlines.h
index ba174c9b2a6..03b64012a74 100644
--- a/src/plugins/acl/public_inlines.h
+++ b/src/plugins/acl/public_inlines.h
@@ -292,8 +292,8 @@ single_acl_match_5tuple (acl_main_t * am, u32 acl_index, fa_5tuple_t * pkt_5tupl
u32 * r_rule_match_p, u32 * trace_bitmap)
{
int i;
- acl_list_t *a;
acl_rule_t *r;
+ acl_rule_t *acl_rules;
if (pool_is_free_index (am->acls, acl_index))
{
@@ -304,10 +304,10 @@ single_acl_match_5tuple (acl_main_t * am, u32 acl_index, fa_5tuple_t * pkt_5tupl
/* the ACL does not exist but is used for policy. Block traffic. */
return 0;
}
- a = am->acls + acl_index;
- for (i = 0; i < a->count; i++)
+ acl_rules = am->acls[acl_index].rules;
+ for (i = 0; i < vec_len(acl_rules); i++)
{
- r = a->rules + i;
+ r = &acl_rules[i];
if (is_ip6 != r->is_ipv6)
{
continue;