summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/fib/fib_api.c')
-rw-r--r--src/vnet/fib/fib_api.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vnet/fib/fib_api.c b/src/vnet/fib/fib_api.c
index 0254c551411..3ccb9cab5ae 100644
--- a/src/vnet/fib/fib_api.c
+++ b/src/vnet/fib/fib_api.c
@@ -65,10 +65,8 @@ static void
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)
- clib_memcpy (&out->ip4, &in->nh.address.ip4, sizeof (out->ip4));
- else if (in->proto == FIB_API_PATH_NH_PROTO_IP6)
- clib_memcpy (&out->ip6, &in->nh.address.ip6, sizeof (out->ip6));
+ ASSERT (FIB_API_PATH_NH_PROTO_IP4 == in->proto || FIB_API_PATH_NH_PROTO_IP6 == in->proto);
+ *out = to_ip46 (FIB_API_PATH_NH_PROTO_IP6 == in->proto, (void *)&in->nh.address);
}
static vl_api_fib_path_nh_proto_t