aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/dhcp6_ia_na_client_dp.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2019-10-01 11:30:56 +0200
committerOle Trøan <otroan@employees.org>2019-10-03 10:07:21 +0000
commit103ba6ba9ecd1d65bcbd3bb4edc115beb9ee7671 (patch)
treeeca605b6a3860425958b501b9eb215f8ac84326c /src/vnet/dhcp/dhcp6_ia_na_client_dp.c
parentd6d50cebde647f9a5ee7251a7fef977506f315d7 (diff)
dhcp: API cleanup
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ia63d920788add2584060a240321acced7a471640
Diffstat (limited to 'src/vnet/dhcp/dhcp6_ia_na_client_dp.c')
-rw-r--r--src/vnet/dhcp/dhcp6_ia_na_client_dp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vnet/dhcp/dhcp6_ia_na_client_dp.c b/src/vnet/dhcp/dhcp6_ia_na_client_dp.c
index 5f940c33687..f49017b0236 100644
--- a/src/vnet/dhcp/dhcp6_ia_na_client_dp.c
+++ b/src/vnet/dhcp/dhcp6_ia_na_client_dp.c
@@ -25,6 +25,7 @@
#include <vlibmemory/api.h>
#include <vnet/dhcp/dhcp6_ia_na_client_dp.h>
#include <vnet/dhcp/dhcp6_client_common_dp.h>
+#include <vnet/ip/ip_types_api.h>
#include <vnet/vnet_msg_enum.h>
@@ -454,7 +455,7 @@ void
params.mrt = ntohl (mp->mrt);
params.mrc = ntohl (mp->mrc);
params.mrd = ntohl (mp->mrd);
- params.msg_type = mp->msg_type;
+ params.msg_type = ntohl (mp->msg_type);
params.T1 = ntohl (mp->T1);
params.T2 = ntohl (mp->T2);
n_addresses = ntohl (mp->n_addresses);
@@ -467,7 +468,7 @@ void
dhcp6_send_client_message_params_address_t *addr = &params.addresses[i];
addr->preferred_lt = ntohl (ai->preferred_time);
addr->valid_lt = ntohl (ai->valid_time);
- memcpy (addr->address.as_u8, ai->address, 16);
+ ip6_address_decode (ai->address, &addr->address);
}
dhcp6_send_client_message (vm, ntohl (mp->sw_if_index), mp->stop, &params);
@@ -535,7 +536,7 @@ dhcp6_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
for (j = 0; j < vec_len (events[i].addresses); j++)
{
dhcp6_address_info_t *info = &events[i].addresses[j];
- memcpy (address->address, &info->address, 16);
+ ip6_address_encode (&info->address, address->address);
address->valid_time = htonl (info->valid_time);
address->preferred_time = htonl (info->preferred_time);
address++;