diff options
author | Dave Barach <dave@barachs.net> | 2021-02-15 12:46:47 -0500 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2021-02-15 19:27:09 +0000 |
commit | 99c6dc6a7a36c0be95da9afb3ad8830b24754d4e (patch) | |
tree | cadd66a12dcc8af5a941de36cce1e2d3c7d7953b /src/vnet/classify | |
parent | 6531514569d8b08242c738c61d3453468a44f7ca (diff) |
misc: coverity fixes
Type: fix
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I6a3348c7edd1cce6b407d336443103f77392bc5d
Diffstat (limited to 'src/vnet/classify')
-rw-r--r-- | src/vnet/classify/classify_api.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vnet/classify/classify_api.c b/src/vnet/classify/classify_api.c index 4b182ca9a0a..7c08528f58a 100644 --- a/src/vnet/classify/classify_api.c +++ b/src/vnet/classify/classify_api.c @@ -101,11 +101,9 @@ static void vl_api_classify_pcap_lookup_table_t_handler u32 mask_len = ntohl (mp->mask_len); u32 sw_if_index = ntohl (mp->sw_if_index); - if (n_skip > 5 - || 0 <= n_match || n_match > 5 - || mask_len != n_match * sizeof (u32x4) - || sw_if_index == ~0 - || sw_if_index >= vec_len (cm->classify_table_index_by_sw_if_index)) + if (n_skip > 5 || n_match == 0 || n_match > 5 || + mask_len != n_match * sizeof (u32x4) || sw_if_index == ~0 || + sw_if_index >= vec_len (cm->classify_table_index_by_sw_if_index)) { rv = VNET_API_ERROR_INVALID_VALUE; goto out; |