summaryrefslogtreecommitdiffstats
path: root/src/vnet/gre
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-01-06 00:22:54 -0500
committerJohn Lo <loj@cisco.com>2018-01-06 00:22:54 -0500
commit72247c803250894834d15952a6fddcd8f4a39a9c (patch)
treee642c6eb05ccdec8a80a136b36b6e8c17e4b5fea /src/vnet/gre
parent1f720c3b1958ac785671a5d7f69841c91d9abf96 (diff)
GRE tunnel key should use fib_index instead of fib_id (VPP-1118)
The code path in src/vnet/gre/interface.c uses fib_id as a component to generate hash key for GRE tunnel. This should be fib_index as the GRE rx/decap data path will be using fib_index to generate the hash key to lookup the GRE tunnel. Change-Id: Ia7f0892d84f9dac79223a6e016775892b61eb5fb Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet/gre')
-rw-r--r--src/vnet/gre/interface.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vnet/gre/interface.c b/src/vnet/gre/interface.c
index f10353773bc..8b1ad6b7dbe 100644
--- a/src/vnet/gre/interface.c
+++ b/src/vnet/gre/interface.c
@@ -270,7 +270,7 @@ vnet_gre_tunnel_add (vnet_gre_add_del_tunnel_args_t * a, u32 * sw_if_indexp)
return VNET_API_ERROR_NO_SUCH_FIB;
t =
- gre_tunnel_db_find (&a->src, &a->dst, a->outer_fib_id, a->is_ipv6, &key);
+ gre_tunnel_db_find (&a->src, &a->dst, outer_fib_index, a->is_ipv6, &key);
if (NULL != t)
return VNET_API_ERROR_INVALID_VALUE;
@@ -426,9 +426,18 @@ vnet_gre_tunnel_delete (vnet_gre_add_del_tunnel_args_t * a,
gre_tunnel_t *t;
gre_tunnel_key_t key;
u32 sw_if_index;
+ u32 outer_fib_index;
+
+ if (!a->is_ipv6)
+ outer_fib_index = ip4_fib_index_from_table_id (a->outer_fib_id);
+ else
+ outer_fib_index = ip6_fib_index_from_table_id (a->outer_fib_id);
+
+ if (~0 == outer_fib_index)
+ return VNET_API_ERROR_NO_SUCH_FIB;
t =
- gre_tunnel_db_find (&a->src, &a->dst, a->outer_fib_id, a->is_ipv6, &key);
+ gre_tunnel_db_find (&a->src, &a->dst, outer_fib_index, a->is_ipv6, &key);
if (NULL == t)
return VNET_API_ERROR_NO_SUCH_ENTRY;