summaryrefslogtreecommitdiffstats
path: root/src/plugins/dhcp
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-10-20 16:24:17 +0200
committerDamjan Marion <dmarion@me.com>2020-11-13 11:17:50 +0000
commitb44c77d01dcf9ebf80d7bcab097515ad8135bc05 (patch)
tree71070f6ea6b5dc989730e1775f6c7916a07938fc /src/plugins/dhcp
parent41c0f45a56d4db5b2ee4ae4fff7f3f0571a23189 (diff)
ethernet: mac must support 64-bits loads
ethernet dataplane loads MAC addresses as 64-bits loads for efficiency. We must make sure it is valid, especially for the vector of secondary MACs. Type: fix Change-Id: I851e319b8a973c154e85ff9f05f3b8e385939788 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/dhcp')
-rw-r--r--src/plugins/dhcp/dhcp4_proxy_node.c4
-rw-r--r--src/plugins/dhcp/dhcp6_client_common_dp.c2
-rw-r--r--src/plugins/dhcp/dhcp6_proxy_node.c3
3 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/dhcp/dhcp4_proxy_node.c b/src/plugins/dhcp/dhcp4_proxy_node.c
index bf1d12ded1a..6a3c51018d1 100644
--- a/src/plugins/dhcp/dhcp4_proxy_node.c
+++ b/src/plugins/dhcp/dhcp4_proxy_node.c
@@ -738,8 +738,8 @@ dhcp_proxy_to_client_input (vlib_main_t * vm,
hi0 = vnet_get_sup_hw_interface (vnm, original_sw_if_index);
ei0 = pool_elt_at_index (em->interfaces, hi0->hw_instance);
- clib_memcpy (mac0->src_address, ei0->address,
- sizeof (ei0->address));
+ clib_memcpy (mac0->src_address, &ei0->address,
+ sizeof (mac0->src_address));
clib_memset (mac0->dst_address, 0xff, sizeof (mac0->dst_address));
if (si0->type == VNET_SW_INTERFACE_TYPE_SUB
diff --git a/src/plugins/dhcp/dhcp6_client_common_dp.c b/src/plugins/dhcp/dhcp6_client_common_dp.c
index f8a96f151e3..2acd2f6ab90 100644
--- a/src/plugins/dhcp/dhcp6_client_common_dp.c
+++ b/src/plugins/dhcp/dhcp6_client_common_dp.c
@@ -71,7 +71,7 @@ generate_client_duid (void)
/* *INDENT-ON* */
if (eth_if)
- clib_memcpy (client_duid.lla, eth_if->address, 6);
+ clib_memcpy (client_duid.lla, &eth_if->address, 6);
else
{
clib_warning ("Failed to find any Ethernet interface, "
diff --git a/src/plugins/dhcp/dhcp6_proxy_node.c b/src/plugins/dhcp/dhcp6_proxy_node.c
index 9b62cafda77..3b95e7f9f09 100644
--- a/src/plugins/dhcp/dhcp6_proxy_node.c
+++ b/src/plugins/dhcp/dhcp6_proxy_node.c
@@ -784,7 +784,8 @@ dhcpv6_proxy_to_client_input (vlib_main_t * vm,
hi0 = vnet_get_sup_hw_interface (vnm, original_sw_if_index);
ei0 = pool_elt_at_index (em->interfaces, hi0->hw_instance);
- clib_memcpy (mac0->src_address, ei0->address, sizeof (ei0->address));
+ clib_memcpy (mac0->src_address, &ei0->address,
+ sizeof (mac0->src_address));
clib_memset (&mac0->dst_address, 0xff, sizeof (mac0->dst_address));
if (si0->type == VNET_SW_INTERFACE_TYPE_SUB && outer_vlan != (u32) ~ 0)