summaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/dhcp6_pd_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_pd_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_pd_client_dp.c')
-rw-r--r--src/vnet/dhcp/dhcp6_pd_client_dp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/vnet/dhcp/dhcp6_pd_client_dp.c b/src/vnet/dhcp/dhcp6_pd_client_dp.c
index c1bf5f8844f..c665b17281a 100644
--- a/src/vnet/dhcp/dhcp6_pd_client_dp.c
+++ b/src/vnet/dhcp/dhcp6_pd_client_dp.c
@@ -25,6 +25,7 @@
#include <vlibmemory/api.h>
#include <vnet/dhcp/dhcp6_pd_client_dp.h>
#include <vnet/dhcp/dhcp6_client_common_dp.h>
+#include <vnet/ip/ip_types_api.h>
#include <vnet/vnet_msg_enum.h>
@@ -457,7 +458,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_prefixes = ntohl (mp->n_prefixes);
@@ -471,8 +472,8 @@ void
&params.prefixes[i];
pref->preferred_lt = ntohl (pi->preferred_time);
pref->valid_lt = ntohl (pi->valid_time);
- memcpy (pref->prefix.as_u8, pi->prefix, 16);
- pref->prefix_length = pi->prefix_length;
+ ip6_address_decode (pi->prefix.address, &pref->prefix);
+ pref->prefix_length = pi->prefix.len;
}
dhcp6_pd_send_client_message (vm, ntohl (mp->sw_if_index), mp->stop,
@@ -542,8 +543,8 @@ dhcp6_pd_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
for (j = 0; j < vec_len (events[i].prefixes); j++)
{
dhcp6_prefix_info_t *info = &events[i].prefixes[j];
- memcpy (prefix->prefix, &info->prefix, 16);
- prefix->prefix_length = info->prefix_length;
+ ip6_address_encode (&info->prefix, prefix->prefix.address);
+ prefix->prefix.len = info->prefix_length;
prefix->valid_time = htonl (info->valid_time);
prefix->preferred_time = htonl (info->preferred_time);
prefix++;