summaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-cp/one_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/lisp-cp/one_api.c')
-rw-r--r--src/vnet/lisp-cp/one_api.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/vnet/lisp-cp/one_api.c b/src/vnet/lisp-cp/one_api.c
index ff00bf5bfce..4faf624014b 100644
--- a/src/vnet/lisp-cp/one_api.c
+++ b/src/vnet/lisp-cp/one_api.c
@@ -448,9 +448,24 @@ vl_api_show_one_use_petr_t_handler (vl_api_show_one_use_petr_t * mp)
/* *INDENT-OFF* */
REPLY_MACRO2 (VL_API_SHOW_ONE_USE_PETR_REPLY,
{
- rmp->status = status;
- gid_address_put (rmp->address, &addr);
- rmp->is_ip4 = (gid_address_ip_version (&addr) == IP4);
+ rmp->status = status;
+ ip_address_t *ip = &gid_address_ip (&addr);
+ switch (ip_addr_version (ip))
+ {
+ case IP4:
+ clib_memcpy (rmp->address, &ip_addr_v4 (ip),
+ sizeof (ip_addr_v4 (ip)));
+ break;
+
+ case IP6:
+ clib_memcpy (rmp->address, &ip_addr_v6 (ip),
+ sizeof (ip_addr_v6 (ip)));
+ break;
+
+ default:
+ ASSERT (0);
+ }
+ rmp->is_ip4 = (gid_address_ip_version (&addr) == IP4);
});
/* *INDENT-ON* */
}