{
b0 = vlib_get_buffer (vm, bi);
len = b0->current_length;
- memcpy((u8 *) tph + TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + offset,
+ clib_memcpy((u8 *) tph + TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + offset,
vlib_buffer_get_current(b0), len);
offset += len;
}
af_packet_main_t * apm = &af_packet_main;
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
af_packet_if_t * apif = pool_elt_at_index (apm->interfaces, hw->dev_instance);
+ u32 hw_flags;
apif->is_admin_up = (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) != 0;
+ if (apif->is_admin_up)
+ hw_flags = VNET_HW_INTERFACE_FLAG_LINK_UP;
+ else
+ hw_flags = 0;
+
+ vnet_hw_interface_set_flags(vnm, hw_if_index, hw_flags);
+
return 0;
}
.admin_up_down_function = af_packet_interface_admin_up_down,
.subif_add_del_function = af_packet_subif_add_del_function,
.no_flatten_output_chains = 1,
-};
\ No newline at end of file
+};
+
+VLIB_DEVICE_TX_FUNCTION_MULTIARCH (af_packet_device_class,
+ af_packet_interface_tx)