+static void
+ethernet_interface_address_copy (ethernet_interface_address_t * dst,
+ const u8 * mac)
+{
+ clib_memcpy (&dst->mac, (u8 *) mac, sizeof (dst->mac));
+ /*
+ * ethernet dataplane loads mac as u64, makes sure the last 2 bytes are 0
+ * for comparison purpose
+ */
+ dst->zero = 0;
+}
+
+static void
+ethernet_set_mac (vnet_hw_interface_t * hi, ethernet_interface_t * ei,
+ const u8 * mac_address)
+{
+ vec_validate (hi->hw_address, sizeof (mac_address_t) - 1);
+ clib_memcpy (hi->hw_address, mac_address, sizeof (mac_address_t));
+ ethernet_interface_address_copy (&ei->address, mac_address);
+}
+