aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2018-10-16 17:18:26 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2018-10-17 07:59:19 +0000
commitda7bcd4bd684843bdadaab1831b12e3cbf1465a7 (patch)
treed4b6631362a2fb082519e4cdf27ae060e940f919
parent9c335ce8e786cb0de22082522347010c47d2f9cc (diff)
acl-plugin: tuplemerge: refresh the pointer to hash-readied ACL entries per each collision in split_partition() (VPP-1458)
A pointer to hash-ready ACL rules is only set once, which might cause a crash if there are colliding entries from more than one ACL applied. Solution: reload the pointer based on the element being processed. Change-Id: I7a701c2c3b4236d67293159f2a33c4f967168953 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com> (cherry picked from commit 84112dd4f98e5a31a8c7340a741f89e77fd03363)
-rw-r--r--src/plugins/acl/hash_lookup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/acl/hash_lookup.c b/src/plugins/acl/hash_lookup.c
index 0c51ab4fc19..2920a1abdbc 100644
--- a/src/plugins/acl/hash_lookup.c
+++ b/src/plugins/acl/hash_lookup.c
@@ -1478,6 +1478,8 @@ split_partition(acl_main_t *am, u32 first_index,
int i=0;
u64 collisions = vec_len(pae->colliding_rules);
for(i=0; i<collisions; i++){
+ /* reload the hash acl info as it might be a different ACL# */
+ ha = vec_elt_at_index(am->hash_acl_infos, pae->acl_index);
DBG( "TM-collision: base_ace:%d (ace_mask:%d, first_collision_mask:%d)",
pae->ace_index, pae->mask_type_index, coll_mask_type_index);