diff options
author | Zhiyong Yang <zhiyong.yang@intel.com> | 2020-01-09 04:20:57 -0500 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2020-08-12 15:24:14 +0000 |
commit | a4200a6824f8867df4f24db7723d78769f68914c (patch) | |
tree | 8376230e93363d2f5cf2ed13cfba295734d8a4a3 | |
parent | 7e8c693f7dd34f6ebe882cf2d667178647413fe4 (diff) |
fib: leverage well-optimized clib_memcpy
Type: fix
Change-Id: I684910837ca4d9c8a07262459158bbb0423a33af
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
(cherry picked from commit d3d7ef5ec828ec895c6f90090118782e497b9084)
-rw-r--r-- | src/vnet/fib/fib_api.c | 8 | ||||
-rw-r--r-- | src/vnet/fib/fib_path.c | 2 | ||||
-rw-r--r-- | src/vnet/fib/fib_types.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/fib/fib_api.c b/src/vnet/fib/fib_api.c index e020b26fd6e..856271f0bc6 100644 --- a/src/vnet/fib/fib_api.c +++ b/src/vnet/fib/fib_api.c @@ -75,9 +75,9 @@ fib_api_next_hop_decode (const vl_api_fib_path_t *in, ip46_address_t *out) { if (in->proto == FIB_API_PATH_NH_PROTO_IP4) - memcpy (&out->ip4, &in->nh.address.ip4, sizeof (out->ip4)); + clib_memcpy (&out->ip4, &in->nh.address.ip4, sizeof (out->ip4)); else if (in->proto == FIB_API_PATH_NH_PROTO_IP6) - memcpy (&out->ip6, &in->nh.address.ip6, sizeof (out->ip6)); + clib_memcpy (&out->ip6, &in->nh.address.ip6, sizeof (out->ip6)); } static vl_api_fib_path_nh_proto_t @@ -110,11 +110,11 @@ fib_api_next_hop_encode (const fib_route_path_t *rpath, fp->proto = fib_api_path_dpo_proto_to_nh(rpath->frp_proto); if (rpath->frp_proto == DPO_PROTO_IP4) - memcpy (&fp->nh.address.ip4, + clib_memcpy (&fp->nh.address.ip4, &rpath->frp_addr.ip4, sizeof (rpath->frp_addr.ip4)); else if (rpath->frp_proto == DPO_PROTO_IP6) - memcpy (&fp->nh.address.ip6, + clib_memcpy (&fp->nh.address.ip6, &rpath->frp_addr.ip6, sizeof (rpath->frp_addr.ip6)); } diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c index 60ba92bf6cc..4af020ba302 100644 --- a/src/vnet/fib/fib_path.c +++ b/src/vnet/fib/fib_path.c @@ -1474,7 +1474,7 @@ fib_path_copy (fib_node_index_t path_index, orig_path = fib_path_get(path_index); ASSERT(NULL != orig_path); - memcpy(path, orig_path, sizeof(*path)); + clib_memcpy(path, orig_path, sizeof(*path)); FIB_PATH_DBG(path, "create-copy:%d", path_index); diff --git a/src/vnet/fib/fib_types.c b/src/vnet/fib/fib_types.c index 3ac5c1d1183..a037750f476 100644 --- a/src/vnet/fib/fib_types.c +++ b/src/vnet/fib/fib_types.c @@ -106,7 +106,7 @@ void fib_prefix_copy (fib_prefix_t *dst, const fib_prefix_t *src) { - memcpy(dst, src, sizeof(*dst)); + clib_memcpy(dst, src, sizeof(*dst)); } int |