summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices/virtio/device.c')
-rw-r--r--src/vnet/devices/virtio/device.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vnet/devices/virtio/device.c b/src/vnet/devices/virtio/device.c
index f5e9bbd441b..6cdb7dcd927 100644
--- a/src/vnet/devices/virtio/device.c
+++ b/src/vnet/devices/virtio/device.c
@@ -488,10 +488,16 @@ virtio_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
virtio_if_t *vif = pool_elt_at_index (mm->interfaces, hw->dev_instance);
if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
- vif->flags |= VIRTIO_IF_FLAG_ADMIN_UP;
+ {
+ vif->flags |= VIRTIO_IF_FLAG_ADMIN_UP;
+ vnet_hw_interface_set_flags (vnm, vif->hw_if_index,
+ VNET_HW_INTERFACE_FLAG_LINK_UP);
+ }
else
- vif->flags &= ~VIRTIO_IF_FLAG_ADMIN_UP;
-
+ {
+ vif->flags &= ~VIRTIO_IF_FLAG_ADMIN_UP;
+ vnet_hw_interface_set_flags (vnm, vif->hw_if_index, 0);
+ }
return 0;
}