aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bfd
diff options
context:
space:
mode:
authorPaul Atkins <patkins@graphiant.com>2022-03-24 11:26:16 +0000
committerDamjan Marion <dmarion@me.com>2022-03-24 19:12:47 +0000
commit0d03284efce17fc088afe8b8a33f01aeeeeecb67 (patch)
tree90875fc198e35be6965b28efdd6de47f7e85b1fd /src/vnet/bfd
parent05ead78945831fbaad6e973d21dfbd9a2c9e2ba4 (diff)
bfd: use local error index when incrementing node counters
When incrementing node counters with vlib_node_increment_counter the local error index should be passed in. vlib_node_increment_counter adds the local index to the nodes base index to get the counter to write to. If we pass in the global counter index, the offset gets added again in the fn, and we then potentially write into memory that is not part of the counter vector. Type: fix Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: I43be33a51bcb52d520495d326b971c1d848d96b5
Diffstat (limited to 'src/vnet/bfd')
-rw-r--r--src/vnet/bfd/bfd_udp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vnet/bfd/bfd_udp.c b/src/vnet/bfd/bfd_udp.c
index e835eac4a13..b715dbb376f 100644
--- a/src/vnet/bfd/bfd_udp.c
+++ b/src/vnet/bfd/bfd_udp.c
@@ -1342,12 +1342,12 @@ bfd_udp_input (vlib_main_t * vm, vlib_node_runtime_t * rt,
if (is_ipv6)
{
vlib_node_increment_counter (vm, bfd_udp6_input_node.index,
- b0->error, 1);
+ error0, 1);
}
else
{
vlib_node_increment_counter (vm, bfd_udp4_input_node.index,
- b0->error, 1);
+ error0, 1);
}
const bfd_udp_session_t *bus = &bs->udp;
ip_adjacency_t *adj = adj_get (bus->adj_index);
@@ -1488,12 +1488,12 @@ bfd_udp_echo_input (vlib_main_t * vm, vlib_node_runtime_t * rt,
if (is_ipv6)
{
vlib_node_increment_counter (vm, bfd_udp_echo6_input_node.index,
- b0->error, 1);
+ BFD_UDP_ERROR_NONE, 1);
}
else
{
vlib_node_increment_counter (vm, bfd_udp_echo4_input_node.index,
- b0->error, 1);
+ BFD_UDP_ERROR_NONE, 1);
}
next0 = BFD_UDP_ECHO_INPUT_NEXT_REPLY_REWRITE;
}