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/lldp/lldp_input.c | 4 ++-- src/plugins/lldp/lldp_node.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/lldp') diff --git a/src/plugins/lldp/lldp_input.c b/src/plugins/lldp/lldp_input.c index 327ef10f9de..b8aa846e385 100644 --- a/src/plugins/lldp/lldp_input.c +++ b/src/plugins/lldp/lldp_input.c @@ -48,13 +48,13 @@ lldp_rpc_update_peer_cb (const lldp_intf_update_t * a) if (n->chassis_id) { - _vec_len (n->chassis_id) = 0; + vec_set_len (n->chassis_id, 0); } vec_add (n->chassis_id, chassis_id, a->chassis_id_len); n->chassis_id_subtype = a->chassis_id_subtype; if (n->port_id) { - _vec_len (n->port_id) = 0; + vec_set_len (n->port_id, 0); } vec_add (n->port_id, portid, a->portid_len); n->port_id_subtype = a->portid_subtype; diff --git a/src/plugins/lldp/lldp_node.c b/src/plugins/lldp/lldp_node.c index dbb54af91f0..d4b6d529d9b 100644 --- a/src/plugins/lldp/lldp_node.c +++ b/src/plugins/lldp/lldp_node.c @@ -220,7 +220,7 @@ lldp_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) #endif if (event_data) { - _vec_len (event_data) = 0; + vec_set_len (event_data, 0); } } -- cgit 1.2.3-korg