summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2016-02-29 15:03:08 +0100
committerGerrit Code Review <gerrit@fd.io>2016-02-29 19:05:09 +0000
commit988a7c482ce1c7685816b238ac776b03c237ed8e (patch)
treedf1de0b583f63150af675f38b6656eb20f2c9db0 /vnet
parent8a4a781e965656c1037f1fb0563d0c93847b11c5 (diff)
Fixed vxlan link status.
Vxlan interface link status corresponds to admin status. When vxlan interfcae is set "admin-up" link status is "link-up" and if interface is set "admin-down" link status is "link-down" also. Change-Id: Iaa85fa8dcd672519312cc7ee6a17df6f4498259d Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/vxlan/vxlan.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/vnet/vnet/vxlan/vxlan.c b/vnet/vnet/vxlan/vxlan.c
index 28ed173c020..6e3842887a7 100644
--- a/vnet/vnet/vxlan/vxlan.c
+++ b/vnet/vnet/vxlan/vxlan.c
@@ -66,11 +66,23 @@ static uword dummy_interface_tx (vlib_main_t * vm,
return frame->n_vectors;
}
+static clib_error_t *
+vxlan_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
+{
+ if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
+ vnet_hw_interface_set_flags (vnm, hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP);
+ else
+ vnet_hw_interface_set_flags (vnm, hw_if_index, 0);
+
+ return /* no error */ 0;
+}
+
VNET_DEVICE_CLASS (vxlan_device_class,static) = {
.name = "VXLAN",
.format_device_name = format_vxlan_name,
.format_tx_trace = format_vxlan_encap_trace,
.tx_function = dummy_interface_tx,
+ .admin_up_down_function = vxlan_interface_admin_up_down,
};
static uword dummy_set_rewrite (vnet_main_t * vnm,