summaryrefslogtreecommitdiffstats
path: root/src/plugins/vrrp/node.c
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2020-02-20 08:58:15 -0600
committerNeale Ranns <nranns@cisco.com>2020-02-21 08:53:57 +0000
commit269549491ae6c8d9c35d6b4fa9441ad15e6b82f0 (patch)
treeec571573c70a1607c03d99f8a5fbb7d77e1fc591 /src/plugins/vrrp/node.c
parent62a7fe28933b6310b9a4e3a0fab99949587576ac (diff)
vrrp: fix coverity errors
Type: fix Fixes: 39e9428b90 Fix warnings about potential problems with an implicit type cast and a null pointer dereference. Change-Id: I8c8d220e79ba45b62ba783cfe53cb49eef175fc8 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/plugins/vrrp/node.c')
-rw-r--r--src/plugins/vrrp/node.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/vrrp/node.c b/src/plugins/vrrp/node.c
index 34d082ec2ff..3355198efe2 100644
--- a/src/plugins/vrrp/node.c
+++ b/src/plugins/vrrp/node.c
@@ -662,12 +662,13 @@ vrrp_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
if (b0->flags & VLIB_BUFFER_IS_TRACED)
{
vrrp_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t));
+ size_t addr_len = (is_ipv6 ? 16 : 4);
t->sw_if_index = vnet_buffer(b0)->sw_if_index[VLIB_RX];
t->is_ipv6 = is_ipv6;
clib_memcpy_fast (&t->vrrp, vrrp0, sizeof (*vrrp0));
clib_memcpy_fast (t->addrs, (void *) (vrrp0 + 1),
- vrrp0->n_addrs * (is_ipv6 ? 16 : 4));
+ (size_t) vrrp0->n_addrs * addr_len);
}
/* always drop, never forward or reply here */