summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-01-08 23:19:18 -0500
committerNeale Ranns <nranns@cisco.com>2018-01-09 16:56:19 +0000
commit20e63bcdf8dafded5624f3377b5a5ce15c697a63 (patch)
tree67942e14c49068a48e1ba10793f4409df52aeea0 /src/vnet
parentf068c3ed296c49dfbfe17677fc1ad2428fb4e3e4 (diff)
GRE tunnel key should use fib_index instead of fib_id (VPP-1118)
Follow up fix - vl_api_gre_add_del_tunnel_t_handler should pass outer_fib_id from API message to vnet_gre_add_del_tunnel() and not convert it to fib_index, since vnet_gre_add_del_tunnel() already perform the lookup to get fib_index from fib_id. Change-Id: I24967a97f82ce018ddef596e556bd3eb1706cb63 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/gre/gre_api.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/vnet/gre/gre_api.c b/src/vnet/gre/gre_api.c
index ceeb1d4c697..bcf01e2153f 100644
--- a/src/vnet/gre/gre_api.c
+++ b/src/vnet/gre/gre_api.c
@@ -54,19 +54,8 @@ static void vl_api_gre_add_del_tunnel_t_handler
vl_api_gre_add_del_tunnel_reply_t *rmp;
int rv = 0;
vnet_gre_add_del_tunnel_args_t _a, *a = &_a;
- u32 outer_fib_id;
- u32 p;
u32 sw_if_index = ~0;
- p = fib_table_find (!mp->is_ipv6 ? FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6,
- ntohl (mp->outer_fib_id));
- if (p == ~0)
- {
- rv = VNET_API_ERROR_NO_SUCH_FIB;
- goto out;
- }
- outer_fib_id = p;
-
/* Check src & dst are different */
if ((mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 16) == 0) ||
(!mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 4) == 0))
@@ -92,7 +81,7 @@ static void vl_api_gre_add_del_tunnel_t_handler
clib_memcpy (&(a->dst.ip6), mp->dst_address, 16);
}
- a->outer_fib_id = outer_fib_id;
+ a->outer_fib_id = ntohl (mp->outer_fib_id);
rv = vnet_gre_add_del_tunnel (a, &sw_if_index);
out: