aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2017-03-02 12:51:45 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-02 20:37:22 +0000
commit0eb22efbb54fe2e56ce8928476fffa381cb1ca8b (patch)
tree13767283577969807456e9830ba36b38bd6c5b58 /src
parenta1a093d4e46e38503332a97ad216f80053a15f2b (diff)
Fix create_vlan_subif API using sw_if_index as hw_if_index
Also added check for bounded interface. Change-Id: I44b981d5b6fbe360e0b95c326f3f8b0e6c715468 Signed-off-by: John Lo <loj@cisco.com>
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)