From b5395729c7b08c88f2e520c06b0edec28d3a1fe1 Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Wed, 20 Mar 2019 11:11:19 +0100 Subject: 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 --- src/plugins/acl/public_inlines.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/acl/public_inlines.h') 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; -- cgit 1.2.3-korg