aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bonding/bond_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/bonding/bond_api.c')
-rw-r--r--src/vnet/bonding/bond_api.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/vnet/bonding/bond_api.c b/src/vnet/bonding/bond_api.c
index 3fd73d7995f..d9287a8e23d 100644
--- a/src/vnet/bonding/bond_api.c
+++ b/src/vnet/bonding/bond_api.c
@@ -43,8 +43,11 @@ vl_api_bond_delete_t_handler (vl_api_bond_delete_t * mp)
vl_api_bond_delete_reply_t *rmp;
u32 sw_if_index = ntohl (mp->sw_if_index);
+ VALIDATE_SW_IF_INDEX (mp);
+
rv = bond_delete_if (vm, sw_if_index);
+ BAD_SW_IF_INDEX_LABEL;
REPLY_MACRO (VL_API_BOND_DELETE_REPLY);
}
@@ -72,12 +75,10 @@ vl_api_bond_create_t_handler (vl_api_bond_create_t * mp)
int rv = ap->rv;
- /* *INDENT-OFF* */
REPLY_MACRO2(VL_API_BOND_CREATE_REPLY,
({
rmp->sw_if_index = ntohl (ap->sw_if_index);
}));
- /* *INDENT-ON* */
}
static void
@@ -105,12 +106,10 @@ vl_api_bond_create2_t_handler (vl_api_bond_create2_t * mp)
int rv = ap->rv;
- /* *INDENT-OFF* */
REPLY_MACRO2(VL_API_BOND_CREATE2_REPLY,
({
rmp->sw_if_index = ntohl (ap->sw_if_index);
}));
- /* *INDENT-ON* */
}
static void
@@ -168,6 +167,8 @@ static void
vl_api_sw_interface_set_bond_weight_reply_t *rmp;
int rv = 0;
+ VALIDATE_SW_IF_INDEX (mp);
+
clib_memset (ap, 0, sizeof (*ap));
ap->sw_if_index = ntohl (mp->sw_if_index);
@@ -176,6 +177,7 @@ static void
bond_set_intf_weight (vm, ap);
rv = ap->rv;
+ BAD_SW_IF_INDEX_LABEL;
REPLY_MACRO (VL_API_SW_INTERFACE_SET_BOND_WEIGHT_REPLY);
}
@@ -187,12 +189,15 @@ vl_api_bond_detach_slave_t_handler (vl_api_bond_detach_slave_t * mp)
bond_detach_member_args_t _a, *ap = &_a;
int rv = 0;
+ VALIDATE_SW_IF_INDEX (mp);
+
clib_memset (ap, 0, sizeof (*ap));
ap->member = ntohl (mp->sw_if_index);
bond_detach_member (vm, ap);
rv = ap->rv;
+ BAD_SW_IF_INDEX_LABEL;
REPLY_MACRO (VL_API_BOND_DETACH_SLAVE_REPLY);
}
@@ -204,12 +209,15 @@ vl_api_bond_detach_member_t_handler (vl_api_bond_detach_member_t * mp)
bond_detach_member_args_t _a, *ap = &_a;
int rv = 0;
+ VALIDATE_SW_IF_INDEX (mp);
+
clib_memset (ap, 0, sizeof (*ap));
ap->member = ntohl (mp->sw_if_index);
bond_detach_member (vm, ap);
rv = ap->rv;
+ BAD_SW_IF_INDEX_LABEL;
REPLY_MACRO (VL_API_BOND_DETACH_MEMBER_REPLY);
}