aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-gpe/lisp_gpe_api.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-06-09 10:22:22 -0700
committerFlorin Coras <fcoras@cisco.com>2017-06-09 10:22:22 -0700
commit27b390e87d0c46400c8a4034b441077f3443dfe1 (patch)
tree5e02d8a9b99e367f99330f33ccdf7621867e5384 /src/vnet/lisp-gpe/lisp_gpe_api.c
parent93992a9048cb6e5dcd22de5091e72de778122627 (diff)
Fix gpe coverity issue (VPP-874)
Change-Id: I70fb60619a0a02d891276ea6c7ac277ba2b26fa3 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/lisp-gpe/lisp_gpe_api.c')
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_api.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vnet/lisp-gpe/lisp_gpe_api.c b/src/vnet/lisp-gpe/lisp_gpe_api.c
index 4df743cde44..cb18b4bb980 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_api.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_api.c
@@ -466,7 +466,7 @@ static void
static void
gpe_native_fwd_rpaths_copy (vl_api_gpe_native_fwd_rpath_t * dst,
- fib_route_path_t * src)
+ fib_route_path_t * src, u8 is_ip4)
{
fib_route_path_t *e;
u32 i = 0;
@@ -474,7 +474,11 @@ gpe_native_fwd_rpaths_copy (vl_api_gpe_native_fwd_rpath_t * dst,
vec_foreach (e, src)
{
memset (&dst[i], 0, sizeof (*dst));
- clib_memcpy (&dst[i], e, sizeof (fib_route_path_t *));
+ dst[i].fib_index = e->frp_fib_index;
+ dst[i].nh_sw_if_index = e->frp_sw_if_index;
+ dst[i].is_ip4 = is_ip4;
+ clib_memcpy (&dst[i].nh_addr, &e->frp_addr,
+ is_ip4 ? sizeof (ip4_address_t) : sizeof (ip6_address_t));
}
}
@@ -517,7 +521,8 @@ vl_api_gpe_native_fwd_rpaths_get_t_handler (vl_api_gpe_native_fwd_rpaths_get_t
{
rmp->count = vec_len (lgm->native_fwd_rpath[mp->is_ip4]);
gpe_native_fwd_rpaths_copy (rmp->entries,
- lgm->native_fwd_rpath[mp->is_ip4]);
+ lgm->native_fwd_rpath[mp->is_ip4],
+ mp->is_ip4);
gpe_native_fwd_rpaths_get_reply_t_host_to_net (rmp);
});
/* *INDENT-ON* */