aboutsummaryrefslogtreecommitdiffstats
path: root/extras
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 /extras
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 'extras')
-rw-r--r--extras/vom/vom/dhcp_client.cpp7
-rw-r--r--extras/vom/vom/dhcp_client_cmds.cpp7
2 files changed, 8 insertions, 6 deletions
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<const char*>(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<dhcp_client::lease_t>(
- 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<interface> itf = interface::find(payload.lease.sw_if_index);
if (itf) {
std::shared_ptr<dhcp_client::lease_t> ev =
std::make_shared<dhcp_client::lease_t>(
- s, itf, from_bytes(0, payload.lease.router_address), pfx,
- reinterpret_cast<const char*>(payload.lease.hostname),
+ s, itf, from_bytes(0, (uint8_t*)&payload.lease.router_address.un),
+ pfx, reinterpret_cast<const char*>(payload.lease.hostname),
mac_address_t(payload.lease.host_mac));
m_listener.handle_dhcp_event(ev);