aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/interface.c7
-rw-r--r--src/vnet/interface.h3
-rw-r--r--src/vnet/interface_format.c4
3 files changed, 13 insertions, 1 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index 24f216f63b9..41e218642f7 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -482,6 +482,13 @@ vnet_sw_interface_set_flags_helper (vnet_main_t * vnm, u32 sw_if_index,
vnet_device_class_t *dev_class =
vnet_get_device_class (vnm, hi->dev_class_index);
+ if ((flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) &&
+ (si->flags & VNET_SW_INTERFACE_FLAG_ERROR))
+ {
+ error = clib_error_return (0, "Interface in the error state");
+ goto done;
+ }
+
/* save the si admin up flag */
old_flags = si->flags;
diff --git a/src/vnet/interface.h b/src/vnet/interface.h
index 1c9855581f0..095fe9617e2 100644
--- a/src/vnet/interface.h
+++ b/src/vnet/interface.h
@@ -573,6 +573,9 @@ typedef struct
/* Interface does not appear in CLI/API */
#define VNET_SW_INTERFACE_FLAG_HIDDEN (1 << 5)
+/* Interface in ERROR state */
+#define VNET_SW_INTERFACE_FLAG_ERROR (1 << 6)
+
/* Index for this interface. */
u32 sw_if_index;
diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c
index 03caf5c6dd7..df7e938894a 100644
--- a/src/vnet/interface_format.c
+++ b/src/vnet/interface_format.c
@@ -45,7 +45,9 @@ format_vnet_sw_interface_flags (u8 * s, va_list * args)
{
u32 flags = va_arg (*args, u32);
- if (flags & VNET_SW_INTERFACE_FLAG_BOND_SLAVE)
+ if (flags & VNET_SW_INTERFACE_FLAG_ERROR)
+ s = format (s, "error");
+ else if (flags & VNET_SW_INTERFACE_FLAG_BOND_SLAVE)
s = format (s, "bond-slave");
else
{