summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/l2')
-rw-r--r--src/vnet/l2/l2_fwd.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/vnet/l2/l2_fwd.c b/src/vnet/l2/l2_fwd.c
index 93e69db31e9..f440778417f 100644
--- a/src/vnet/l2/l2_fwd.c
+++ b/src/vnet/l2/l2_fwd.c
@@ -61,8 +61,8 @@ typedef struct
typedef struct
{
/* per-pkt trace data */
- u8 src[6];
u8 dst[6];
+ u8 src[6];
u32 sw_if_index;
u16 bd_index;
l2fib_entry_result_t result;
@@ -324,8 +324,9 @@ l2fwd_node_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
l2fwd_trace_t *t = vlib_add_trace (vm, node, b[0], sizeof (*t));
t->sw_if_index = sw_if_index0;
t->bd_index = vnet_buffer (b[0])->l2.bd_index;
- clib_memcpy_fast (t->src, h0->src_address, 6);
- clib_memcpy_fast (t->dst, h0->dst_address, 6);
+ clib_memcpy_fast (t->dst, h0->dst_address,
+ sizeof (h0->dst_address) +
+ sizeof (h0->src_address));
t->result = result0;
}
if (b[1]->flags & VLIB_BUFFER_IS_TRACED)
@@ -333,8 +334,9 @@ l2fwd_node_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
l2fwd_trace_t *t = vlib_add_trace (vm, node, b[1], sizeof (*t));
t->sw_if_index = sw_if_index1;
t->bd_index = vnet_buffer (b[1])->l2.bd_index;
- clib_memcpy_fast (t->src, h1->src_address, 6);
- clib_memcpy_fast (t->dst, h1->dst_address, 6);
+ clib_memcpy_fast (t->dst, h1->dst_address,
+ sizeof (h1->dst_address) +
+ sizeof (h1->src_address));
t->result = result1;
}
if (b[2]->flags & VLIB_BUFFER_IS_TRACED)
@@ -342,8 +344,9 @@ l2fwd_node_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
l2fwd_trace_t *t = vlib_add_trace (vm, node, b[2], sizeof (*t));
t->sw_if_index = sw_if_index2;
t->bd_index = vnet_buffer (b[2])->l2.bd_index;
- clib_memcpy_fast (t->src, h2->src_address, 6);
- clib_memcpy_fast (t->dst, h2->dst_address, 6);
+ clib_memcpy_fast (t->dst, h2->dst_address,
+ sizeof (h2->dst_address) +
+ sizeof (h2->src_address));
t->result = result2;
}
if (b[3]->flags & VLIB_BUFFER_IS_TRACED)
@@ -351,8 +354,9 @@ l2fwd_node_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
l2fwd_trace_t *t = vlib_add_trace (vm, node, b[3], sizeof (*t));
t->sw_if_index = sw_if_index3;
t->bd_index = vnet_buffer (b[3])->l2.bd_index;
- clib_memcpy_fast (t->src, h3->src_address, 6);
- clib_memcpy_fast (t->dst, h3->dst_address, 6);
+ clib_memcpy_fast (t->dst, h3->dst_address,
+ sizeof (h3->dst_address) +
+ sizeof (h3->src_address));
t->result = result3;
}
}
@@ -387,8 +391,9 @@ l2fwd_node_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
l2fwd_trace_t *t = vlib_add_trace (vm, node, b[0], sizeof (*t));
t->sw_if_index = sw_if_index0;
t->bd_index = vnet_buffer (b[0])->l2.bd_index;
- clib_memcpy_fast (t->src, h0->src_address, 6);
- clib_memcpy_fast (t->dst, h0->dst_address, 6);
+ clib_memcpy_fast (t->dst, h0->dst_address,
+ sizeof (h0->dst_address) +
+ sizeof (h0->src_address));
t->result = result0;
}