diff options
Diffstat (limited to 'src/vnet/dhcp/dhcp_api.c')
-rw-r--r-- | src/vnet/dhcp/dhcp_api.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vnet/dhcp/dhcp_api.c b/src/vnet/dhcp/dhcp_api.c index c96c3e1e085..d71ffe93c2d 100644 --- a/src/vnet/dhcp/dhcp_api.c +++ b/src/vnet/dhcp/dhcp_api.c @@ -218,6 +218,7 @@ dhcp_client_lease_encode (vl_api_dhcp_lease_t * lease, const dhcp_client_t * client) { size_t len; + u8 i; lease->is_ipv6 = 0; // only support IPv6 clients lease->sw_if_index = ntohl (client->sw_if_index); @@ -227,8 +228,16 @@ dhcp_client_lease_encode (vl_api_dhcp_lease_t * lease, lease->hostname[len] = 0; lease->mask_width = client->subnet_mask_width; - clib_memcpy (&lease->host_address[0], (u8 *) & client->leased_address, 4); - clib_memcpy (&lease->router_address[0], (u8 *) & client->router_address, 4); + clib_memcpy (&lease->host_address[0], (u8 *) & client->leased_address, + sizeof (ip4_address_t)); + clib_memcpy (&lease->router_address[0], (u8 *) & client->router_address, + sizeof (ip4_address_t)); + + lease->count = vec_len (client->domain_server_address); + for (i = 0; i < lease->count; i++) + clib_memcpy (&lease->domain_server[i].address, + (u8 *) & client->domain_server_address[i], + sizeof (ip4_address_t)); if (NULL != client->l2_rewrite) clib_memcpy (&lease->host_mac[0], client->l2_rewrite + 6, 6); |