fix vector index range checks
Change-Id: I63c36644c9d93f2c3ec6606ca0205b407499de4e
Signed-off-by: Eyal Bari <ebari@cisco.com>
diff --git a/src/vnet/ipip/ipip.c b/src/vnet/ipip/ipip.c
index a47704a..c49be09 100644
--- a/src/vnet/ipip/ipip.c
+++ b/src/vnet/ipip/ipip.c
@@ -355,7 +355,7 @@
ipip_tunnel_db_find_by_sw_if_index (u32 sw_if_index)
{
ipip_main_t *gm = &ipip_main;
- if (vec_len (gm->tunnel_index_by_sw_if_index) < sw_if_index)
+ if (vec_len (gm->tunnel_index_by_sw_if_index) <= sw_if_index)
return NULL;
u32 ti = gm->tunnel_index_by_sw_if_index[sw_if_index];
if (ti == ~0)