From 467c1e918ad06bb2da16533edfb4b1b9e4795d63 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Sun, 17 Dec 2017 01:39:52 +0100 Subject: [5452] Checkpoint: ported #5351 subnet/hr toElement fixes --- src/lib/dhcpsrv/host.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib/dhcpsrv/host.cc') diff --git a/src/lib/dhcpsrv/host.cc b/src/lib/dhcpsrv/host.cc index 573047bdaf..8359780141 100644 --- a/src/lib/dhcpsrv/host.cc +++ b/src/lib/dhcpsrv/host.cc @@ -432,9 +432,11 @@ Host::toElement4() const { } else { isc_throw(ToElementError, "invalid identifier type: " << id_type); } - // Set the reservation + // Set the reservation (if not 0.0.0.0 which may not be re-read) const IOAddress& address = getIPv4Reservation(); - map->set("ip-address", Element::create(address.toText())); + if (!address.isV4Zero()) { + map->set("ip-address", Element::create(address.toText())); + } // Set the hostname const std::string& hostname = getHostname(); map->set("hostname", Element::create(hostname)); -- cgit v1.2.3