diff --git a/src/lib/dhcpsrv/lease.cc b/src/lib/dhcpsrv/lease.cc index f2af3329a0..5854f06900 100755 --- a/src/lib/dhcpsrv/lease.cc +++ b/src/lib/dhcpsrv/lease.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -293,13 +293,14 @@ Lease6::toText() const { /// @todo: print out DUID stream << "Type: " << typeToText(type_) << "(" - << static_cast(type_) << ")\n"; - stream << "Address: " << addr_ << "\n" + << static_cast(type_) << ")\n" + << "Address: " << addr_ << "\n" << "Prefix length: " << static_cast(prefixlen_) << "\n" << "IAID: " << iaid_ << "\n" << "Pref life: " << preferred_lft_ << "\n" << "Valid life: " << valid_lft_ << "\n" << "Cltt: " << cltt_ << "\n" + << "DUID: " << (duid_?duid_->toText():"(none)") << "\n" << "Hardware addr: " << (hwaddr_?hwaddr_->toText(false):"(none)") << "\n" << "Subnet ID: " << subnet_id_ << "\n" << "State: " << statesToText(state_) << "\n"; diff --git a/src/lib/dhcpsrv/lease_file_loader.h b/src/lib/dhcpsrv/lease_file_loader.h index c73770600b..0eb5c54280 100644 --- a/src/lib/dhcpsrv/lease_file_loader.h +++ b/src/lib/dhcpsrv/lease_file_loader.h @@ -1,4 +1,4 @@ -// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -135,7 +135,8 @@ public: storage.erase(lease_it); } else { - **lease_it = *lease; + // Use replace to re-index leases on update. + storage.replace(lease_it, lease); } }