aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/af_packet/device.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/vnet/vnet/devices/af_packet/device.c b/vnet/vnet/devices/af_packet/device.c
index 1e05104cf2a..fa43d7cd804 100644
--- a/vnet/vnet/devices/af_packet/device.c
+++ b/vnet/vnet/devices/af_packet/device.c
@@ -166,9 +166,17 @@ af_packet_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags
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;
}
@@ -195,4 +203,4 @@ VNET_DEVICE_CLASS (af_packet_device_class) = {
.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
+};