From 103ba6ba9ecd1d65bcbd3bb4edc115beb9ee7671 Mon Sep 17 00:00:00 2001 From: Jakub Grajciar Date: Tue, 1 Oct 2019 11:30:56 +0200 Subject: dhcp: API cleanup Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar Change-Id: Ia63d920788add2584060a240321acced7a471640 --- extras/vom/vom/dhcp_client.cpp | 7 ++++--- extras/vom/vom/dhcp_client_cmds.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'extras') diff --git a/extras/vom/vom/dhcp_client.cpp b/extras/vom/vom/dhcp_client.cpp index e3a5b9d5559..23911b3df0e 100644 --- a/extras/vom/vom/dhcp_client.cpp +++ b/extras/vom/vom/dhcp_client.cpp @@ -278,7 +278,8 @@ dhcp_client::event_handler::handle_populate(const client_db::key_t& key) const dhcp_client::state_t& s = dhcp_client::state_t::from_vpp(payload.lease.state); - route::prefix_t pfx(payload.lease.is_ipv6, payload.lease.host_address, + route::prefix_t pfx(payload.lease.is_ipv6, + (uint8_t*)&payload.lease.host_address.un, payload.lease.mask_width); std::string hostname = reinterpret_cast(payload.lease.hostname); @@ -286,8 +287,8 @@ dhcp_client::event_handler::handle_populate(const client_db::key_t& key) dhcp_client dc(*itf, hostname, l2, payload.client.set_broadcast_flag, from_api(payload.client.dscp)); dc.lease(std::make_shared( - s, itf, from_bytes(0, payload.lease.router_address), pfx, hostname, - mac_address_t(payload.lease.host_mac))); + s, itf, from_bytes(0, (uint8_t*)&payload.lease.router_address.un), pfx, + hostname, mac_address_t(payload.lease.host_mac))); OM::commit(key, dc); } } diff --git a/extras/vom/vom/dhcp_client_cmds.cpp b/extras/vom/vom/dhcp_client_cmds.cpp index c1d4d49a495..3f899a63c01 100644 --- a/extras/vom/vom/dhcp_client_cmds.cpp +++ b/extras/vom/vom/dhcp_client_cmds.cpp @@ -173,15 +173,16 @@ events_cmd::notify() const dhcp_client::state_t& s = dhcp_client::state_t::from_vpp(payload.lease.state); - route::prefix_t pfx(payload.lease.is_ipv6, payload.lease.host_address, + route::prefix_t pfx(payload.lease.is_ipv6, + (uint8_t*)&payload.lease.host_address.un, payload.lease.mask_width); std::shared_ptr itf = interface::find(payload.lease.sw_if_index); if (itf) { std::shared_ptr ev = std::make_shared( - s, itf, from_bytes(0, payload.lease.router_address), pfx, - reinterpret_cast(payload.lease.hostname), + s, itf, from_bytes(0, (uint8_t*)&payload.lease.router_address.un), + pfx, reinterpret_cast(payload.lease.hostname), mac_address_t(payload.lease.host_mac)); m_listener.handle_dhcp_event(ev); -- cgit 1.2.3-korg