From 8bea589cfe0fca1a6f560e16ca66a4cf199041a2 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Mon, 4 Apr 2022 22:40:45 +0200 Subject: vppinfra: make _vec_len() read-only Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion --- src/plugins/acl/hash_lookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/acl/hash_lookup.c') diff --git a/src/plugins/acl/hash_lookup.c b/src/plugins/acl/hash_lookup.c index 85b54b3e8ac..c137b15a080 100644 --- a/src/plugins/acl/hash_lookup.c +++ b/src/plugins/acl/hash_lookup.c @@ -682,7 +682,7 @@ hash_acl_apply(acl_main_t *am, u32 lc_index, int acl_index, u32 acl_position) if (vec_len(ha->rules) > 0) { int old_vec_len = vec_len(*applied_hash_aces); vec_validate((*applied_hash_aces), old_vec_len + vec_len(ha->rules) - 1); - _vec_len((*applied_hash_aces)) = old_vec_len; + vec_set_len ((*applied_hash_aces), old_vec_len); } /* add the rules from the ACL to the hash table for lookup and append to the vector*/ @@ -903,7 +903,7 @@ hash_acl_unapply(acl_main_t *am, u32 lc_index, int acl_index) move_applied_ace_hash_entry(am, lc_index, applied_hash_aces, tail_offset + i, base_offset + i); } /* trim the end of the vector */ - _vec_len((*applied_hash_aces)) -= vec_len(ha->rules); + vec_dec_len ((*applied_hash_aces), vec_len (ha->rules)); remake_hash_applied_mask_info_vec(am, applied_hash_aces, lc_index); -- cgit 1.2.3-korg