aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_vtr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/l2/l2_vtr.h')
-rw-r--r--src/vnet/l2/l2_vtr.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/vnet/l2/l2_vtr.h b/src/vnet/l2/l2_vtr.h
index 1cd9209973b..40285873273 100644
--- a/src/vnet/l2/l2_vtr.h
+++ b/src/vnet/l2/l2_vtr.h
@@ -75,15 +75,13 @@ typedef struct
always_inline u32
l2_vtr_process (vlib_buffer_t * b0, vtr_config_t * config)
{
- u64 temp_8;
- u32 temp_4;
u8 *eth;
+ u8 save_macs[12];
eth = vlib_buffer_get_current (b0);
/* copy the 12B dmac and smac to a temporary location */
- temp_8 = *((u64 *) eth);
- temp_4 = *((u32 *) (eth + 8));
+ clib_memcpy_fast (save_macs, eth, sizeof (save_macs));
/* adjust for popped tags */
eth += config->pop_bytes;
@@ -95,7 +93,8 @@ l2_vtr_process (vlib_buffer_t * b0, vtr_config_t * config)
}
/* copy the 2 new tags to the start of the packet */
- *((u64 *) (eth + 12 - 8)) = config->raw_tags;
+ clib_memcpy_fast (eth + 12 - 8, &config->raw_tags,
+ sizeof (config->raw_tags));
/* TODO: set cos bits */
@@ -103,8 +102,7 @@ l2_vtr_process (vlib_buffer_t * b0, vtr_config_t * config)
eth -= config->push_bytes;
/* copy the 12 dmac and smac back to the packet */
- *((u64 *) eth) = temp_8;
- *((u32 *) (eth + 8)) = temp_4;
+ clib_memcpy_fast (eth, save_macs, sizeof (save_macs));
/* Update l2 parameters */
vnet_buffer (b0)->l2.l2_len +=
@@ -124,7 +122,6 @@ l2_vtr_process (vlib_buffer_t * b0, vtr_config_t * config)
return 0;
}
-
/*
* Perform the egress pre-vlan tag rewrite EFP Filter check.
* The post-vlan tag rewrite check is a separate graph node.