summaryrefslogtreecommitdiffstats
path: root/vnet/vnet/interface.c
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-04-05 15:47:43 -0400
committerGerrit Code Review <gerrit@fd.io>2016-04-07 14:33:05 +0000
commitbcebbb988da4fcbb6158c05050f96ae87cc50156 (patch)
tree9542744dbc6315e15b41e361369bb8da983207c5 /vnet/vnet/interface.c
parent2fa6beff5726ecb7c863d0027395ed63dc4831ca (diff)
Enhance CLI/API Support for Bonded Interface
For interfaces which are slave links to a bounded interface, do not allow sub-interface creation nor interface state to be changed. Change "show interface" to display interface state as "bond-slave" for slave links to a bonded interface. Change "show hardware" to support a "bond" keyword and display slave links to a bonded interface. Change-Id: I4db3cae6985bcb1489ab16a07c72c5ee9b2f2dd3 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'vnet/vnet/interface.c')
-rw-r--r--vnet/vnet/interface.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vnet/vnet/interface.c b/vnet/vnet/interface.c
index 6c8823f14bc..9189a4185d8 100644
--- a/vnet/vnet/interface.c
+++ b/vnet/vnet/interface.c
@@ -363,6 +363,15 @@ vnet_sw_interface_set_flags_helper (vnet_main_t * vnm, u32 sw_if_index, u32 flag
}
}
+ /* Donot change state for slave link of bonded interfaces */
+ if (si->flags & VNET_SW_INTERFACE_FLAG_BOND_SLAVE)
+ {
+ error = clib_error_return
+ (0, "not allowed as %U belong to a BondEthernet interface",
+ format_vnet_sw_interface_name, vnm, si);
+ goto done;
+ }
+
/* Already in the desired state? */
if ((si->flags & mask) == flags)
goto done;