summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2016-10-12 13:51:05 +0100
committerChris Luke <chris_luke@comcast.com>2016-10-12 17:51:06 +0000
commit5899fdedad93eec01088dca980e9f5fd70aae9c4 (patch)
tree1e557d6c66c5c80b9f62a6141d095a78969e8330
parent69a9b76d648a108e0a7fad4404b218ebdd6a8ea5 (diff)
Coverity warnings in new FIB code (VPP-484)
Change-Id: Ie221e246dd8c6a1b3c76e7aa85924762d4397782 Signed-off-by: Neale Ranns <nranns@cisco.com>
-rw-r--r--vnet/vnet/fib/fib_entry_src_interface.c2
-rw-r--r--vnet/vnet/fib/fib_entry_src_lisp.c5
-rw-r--r--vnet/vnet/fib/fib_entry_src_mpls.c2
-rw-r--r--vnet/vnet/fib/fib_path_ext.c2
-rw-r--r--vnet/vnet/fib/fib_test.c6
-rw-r--r--vnet/vnet/fib/fib_walk.c4
-rw-r--r--vnet/vnet/ip/ip4_forward.c2
-rw-r--r--vnet/vnet/lisp-gpe/lisp_gpe_tenant.c1
-rw-r--r--vnet/vnet/mpls/mpls.c10
9 files changed, 27 insertions, 7 deletions
diff --git a/vnet/vnet/fib/fib_entry_src_interface.c b/vnet/vnet/fib/fib_entry_src_interface.c
index 2fb61677568..ca04716ed8f 100644
--- a/vnet/vnet/fib/fib_entry_src_interface.c
+++ b/vnet/vnet/fib/fib_entry_src_interface.c
@@ -51,7 +51,7 @@ fib_entry_src_interface_path_swap (fib_entry_src_t *src,
src->fes_pl,
fib_entry_get_default_chain_type(entry)));
- if (IP_LOOKUP_NEXT_GLEAN == adj->lookup_next_index);
+ if (IP_LOOKUP_NEXT_GLEAN == adj->lookup_next_index)
{
/*
* the connected prefix will link to a glean on a non-p2p
diff --git a/vnet/vnet/fib/fib_entry_src_lisp.c b/vnet/vnet/fib/fib_entry_src_lisp.c
index 116c492994b..7f8b91bbab6 100644
--- a/vnet/vnet/fib/fib_entry_src_lisp.c
+++ b/vnet/vnet/fib/fib_entry_src_lisp.c
@@ -86,7 +86,10 @@ fib_entry_src_lisp_add (fib_entry_src_t *src,
{
if (FIB_ENTRY_FLAG_NONE != flags)
{
- src->fes_pl = fib_path_list_create_special(proto, flags, dpo);
+ src->fes_pl = fib_path_list_create_special(
+ proto,
+ fib_entry_src_flags_2_path_list_flags(flags),
+ dpo);
}
}
diff --git a/vnet/vnet/fib/fib_entry_src_mpls.c b/vnet/vnet/fib/fib_entry_src_mpls.c
index 79c745acf48..4f4a023fb3d 100644
--- a/vnet/vnet/fib/fib_entry_src_mpls.c
+++ b/vnet/vnet/fib/fib_entry_src_mpls.c
@@ -71,7 +71,7 @@ fib_entry_src_mpls_set_data (fib_entry_src_t *src,
const fib_entry_t *entry,
const void *data)
{
- dpo_proto_t payload_proto;
+ fib_protocol_t payload_proto;
fib_node_index_t fei;
mpls_label_t label;
mpls_eos_bit_t eos;
diff --git a/vnet/vnet/fib/fib_path_ext.c b/vnet/vnet/fib/fib_path_ext.c
index f40c749e981..05e62d96a54 100644
--- a/vnet/vnet/fib/fib_path_ext.c
+++ b/vnet/vnet/fib/fib_path_ext.c
@@ -106,6 +106,8 @@ fib_path_ext_stack (fib_path_ext_t *path_ext,
{
case FIB_FORW_CHAIN_TYPE_MPLS_EOS:
ASSERT(0);
+ return (nhs);
+ break;
case FIB_FORW_CHAIN_TYPE_UNICAST_IP4:
case FIB_FORW_CHAIN_TYPE_UNICAST_IP6:
if (MPLS_IETF_IMPLICIT_NULL_LABEL == path_ext->fpe_label)
diff --git a/vnet/vnet/fib/fib_test.c b/vnet/vnet/fib/fib_test.c
index c9a937ba559..7729209d6ab 100644
--- a/vnet/vnet/fib/fib_test.c
+++ b/vnet/vnet/fib/fib_test.c
@@ -217,6 +217,8 @@ fib_test_urpf_is_equal (fib_node_index_t fei,
dpo_reset(&dpo);
+ va_end(ap);
+
return (1);
}
@@ -4835,7 +4837,9 @@ fib_test_validate_entry (fib_node_index_t fei,
break;
case FIB_PROTOCOL_MPLS:
{
- mpls_unicast_header_t hdr;
+ mpls_unicast_header_t hdr = {
+ .label_exp_s_ttl = 0,
+ };
vnet_mpls_uc_set_label(&hdr.label_exp_s_ttl, pfx.fp_label);
vnet_mpls_uc_set_s(&hdr.label_exp_s_ttl, pfx.fp_eos);
diff --git a/vnet/vnet/fib/fib_walk.c b/vnet/vnet/fib/fib_walk.c
index bb1a2ac564a..1771047a6b4 100644
--- a/vnet/vnet/fib/fib_walk.c
+++ b/vnet/vnet/fib/fib_walk.c
@@ -248,8 +248,8 @@ fib_walk_destroy (fib_walk_t *fwalk)
* add the stats to the continuous histogram collection.
*/
bucket = (fwalk->fw_n_visits / HISTOGRAM_VISITS_PER_WALK_INCR);
- bucket = (bucket > HISTOGRAM_VISITS_PER_WALK_MAX ?
- HISTOGRAM_VISITS_PER_WALK_MAX - 1 :
+ bucket = (bucket > HISTOGRAM_VISITS_PER_WALK_N_BUCKETS ?
+ HISTOGRAM_VISITS_PER_WALK_N_BUCKETS - 1 :
bucket);
fib_walk_hist_vists_per_walk[bucket]++;
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index 321716da2b1..c6a6c72d655 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -193,7 +193,7 @@ ip4_lookup_inline (vlib_main_t * vm,
hash_c0 = vnet_buffer (p0)->ip.flow_hash =
ip4_compute_flow_hash (ip0, flow_hash_config0);
}
- if (PREDICT_FALSE(lb0->lb_n_buckets > 1))
+ if (PREDICT_FALSE(lb1->lb_n_buckets > 1))
{
flow_hash_config1 = lb1->lb_hash_config;
hash_c1 = vnet_buffer (p1)->ip.flow_hash =
diff --git a/vnet/vnet/lisp-gpe/lisp_gpe_tenant.c b/vnet/vnet/lisp-gpe/lisp_gpe_tenant.c
index a7b0dd24b99..6abb7731830 100644
--- a/vnet/vnet/lisp-gpe/lisp_gpe_tenant.c
+++ b/vnet/vnet/lisp-gpe/lisp_gpe_tenant.c
@@ -142,6 +142,7 @@ lisp_gpe_tenant_l3_iface_unlock (u32 vni)
if (NULL == lt)
{
clib_warning ("No tenant for VNI %d", vni);
+ return;
}
if (0 == lt->lt_locks[LISP_GPE_TENANT_LOCK_L3_IFACE])
diff --git a/vnet/vnet/mpls/mpls.c b/vnet/vnet/mpls/mpls.c
index be5e882f1b3..de57da880f2 100644
--- a/vnet/vnet/mpls/mpls.c
+++ b/vnet/vnet/mpls/mpls.c
@@ -744,6 +744,8 @@ vnet_mpls_local_label (vlib_main_t * vm,
is_ip = 0;
table_id = 0;
eos = MPLS_EOS;
+ is_del = 0;
+ local_label = MPLS_LABEL_INVALID;
/* Get a line of input. */
if (! unformat_user (input, unformat_line_input, line_input))
@@ -818,6 +820,14 @@ vnet_mpls_local_label (vlib_main_t * vm,
}
+ if (MPLS_LABEL_INVALID == local_label)
+ {
+ error = clib_error_return (0, "local-label required: %U",
+ format_unformat_error, input);
+ goto done;
+ }
+
+
if (is_ip)
{
u32 fib_index = fib_table_find(pfx.fp_proto, table_id);