aboutsummaryrefslogtreecommitdiffstats
path: root/vpp
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-08-08 13:05:31 -0400
committerDave Barach <dave@barachs.net>2016-08-08 13:09:15 -0400
commit6f6f34f620a18638eb820a9ab3d8a93e350d722a (patch)
treef0e03e0a2e96b10511561e5868a4ff741a9386f4 /vpp
parent06e3d075760be43dbd61385d3c7861cd5fe44af2 (diff)
VPP-189 Clean up more coverity warnings
Change-Id: If66713d79c545c762c385faf08cc809347741152 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vpp')
-rw-r--r--vpp/vpp-api/api.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index bed280a1e61..18063acc7d5 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -2588,9 +2588,11 @@ vl_api_sw_interface_clear_stats_t_handler (vl_api_sw_interface_clear_stats_t *
vlib_combined_counter_main_t *cm;
static vnet_main_t **my_vnet_mains;
int i, j, n_counters;
-
int rv = 0;
+ if (mp->sw_if_index != ~0)
+ VALIDATE_SW_IF_INDEX(mp);
+
vec_reset_length (my_vnet_mains);
for (i = 0; i < vec_len (vnet_mains); i++)
@@ -2632,6 +2634,8 @@ vl_api_sw_interface_clear_stats_t_handler (vl_api_sw_interface_clear_stats_t *
}
}
+ BAD_SW_IF_INDEX_LABEL;
+
REPLY_MACRO (VL_API_SW_INTERFACE_CLEAR_STATS_REPLY);
}
@@ -7768,6 +7772,8 @@ vl_api_ipfix_dump_t_handler (vl_api_ipfix_dump_t * mp)
vl_api_ipfix_details_t *rmp;
q = vl_api_client_index_to_input_queue (mp->client_index);
+ if (!q)
+ return;
rmp = vl_msg_api_alloc (sizeof (*rmp));
memset (rmp, 0, sizeof (*rmp));
@@ -7919,8 +7925,7 @@ static void
}
// Validate mask_length
- if (mask_length < 0 ||
- (is_ipv6 && mask_length > 128) || (!is_ipv6 && mask_length > 32))
+ if ((is_ipv6 && mask_length > 128) || (!is_ipv6 && mask_length > 32))
{
rv = VNET_API_ERROR_ADDRESS_LENGTH_MISMATCH;
goto reply;