diff options
author | Alpesh Patel <apatel9191@hotmail.com> | 2016-04-05 12:49:30 -0700 |
---|---|---|
committer | Alpesh Patel <apatel9191@hotmail.com> | 2016-04-05 13:00:01 -0700 |
commit | 83cc4e140d4fdf915ae027851b442b2ff0a682e8 (patch) | |
tree | c544a9536f9aca650a4e951a439a2b8045db1a30 | |
parent | 33007f505b540149b79b101c0346261b70983e9a (diff) |
host-interface admin down/up does not bring the interface up
Change-Id: I4c9ae5d88e885ccbc85b64cadc052563529c762d
Signed-off-by: Alpesh Patel <apatel9191@hotmail.com>
-rw-r--r-- | vnet/vnet/devices/af_packet/device.c | 10 |
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 +}; |