diff options
author | Damjan Marion <damarion@cisco.com> | 2017-05-10 20:09:31 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-05-10 22:02:22 +0000 |
commit | abce509affe1f25bbb4905670371ad202529d5e0 (patch) | |
tree | 11f0ad91c6eacd916c8914fb87d488fad2968a8b /src/vnet/interface.c | |
parent | f55f9b851f59264d737d92c6277a87588c565d24 (diff) |
vnet: introduce error state for sw interfaces
Interfaces with error state are not allowed to go admin up
Change-Id: I09fc09a5b28130aead219dccbc2e0f30ea7414cf
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/interface.c')
-rw-r--r-- | src/vnet/interface.c | 7 |
1 files changed, 7 insertions, 0 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; |