summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vpp/api/api.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vpp/api/api.c b/src/vpp/api/api.c
index a8f471e864e..6b2329fac74 100644
--- a/src/vpp/api/api.c
+++ b/src/vpp/api/api.c
@@ -492,7 +492,7 @@ vl_api_create_vlan_subif_t_handler (vl_api_create_vlan_subif_t * mp)
{
vl_api_create_vlan_subif_reply_t *rmp;
vnet_main_t *vnm = vnet_get_main ();
- u32 hw_if_index, sw_if_index = (u32) ~ 0;
+ u32 sw_if_index = (u32) ~ 0;
vnet_hw_interface_t *hi;
int rv = 0;
u32 id;
@@ -506,8 +506,13 @@ vl_api_create_vlan_subif_t_handler (vl_api_create_vlan_subif_t * mp)
VALIDATE_SW_IF_INDEX (mp);
- hw_if_index = ntohl (mp->sw_if_index);
- hi = vnet_get_hw_interface (vnm, hw_if_index);
+ hi = vnet_get_sup_hw_interface (vnm, ntohl (mp->sw_if_index));
+
+ if (hi->bond_info == VNET_HW_INTERFACE_BOND_INFO_SLAVE)
+ {
+ rv = VNET_API_ERROR_BOND_SLAVE_NOT_ALLOWED;
+ goto out;
+ }
id = ntohl (mp->vlan_id);
if (id == 0 || id > 4095)