diff options
author | Marcin Siodelski <marcin@isc.org> | 2013-08-20 18:00:13 +0200 |
---|---|---|
committer | Marcin Siodelski <marcin@isc.org> | 2013-08-20 18:00:13 +0200 |
commit | 3bc0e24e4d1692c73124fe9727141cc2552e5aa3 (patch) | |
tree | 602f14a28af52b05c4f28a104c5383aaf7270e27 /src/lib/dhcpsrv/lease_mgr.cc | |
parent | [master] Added ChangeLog entry for #3036. (diff) | |
download | kea-3bc0e24e4d1692c73124fe9727141cc2552e5aa3.tar.xz kea-3bc0e24e4d1692c73124fe9727141cc2552e5aa3.zip |
[3083] Return the old lease instance when new lease is acquired.
Diffstat (limited to 'src/lib/dhcpsrv/lease_mgr.cc')
-rw-r--r-- | src/lib/dhcpsrv/lease_mgr.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/lease_mgr.cc b/src/lib/dhcpsrv/lease_mgr.cc index 2310dd4cd5..c4810fd5f9 100644 --- a/src/lib/dhcpsrv/lease_mgr.cc +++ b/src/lib/dhcpsrv/lease_mgr.cc @@ -38,6 +38,52 @@ Lease::Lease(const isc::asiolink::IOAddress& addr, uint32_t t1, uint32_t t2, subnet_id_(subnet_id), fixed_(false), fqdn_fwd_(false), fqdn_rev_(false) { } +Lease4::Lease4(const Lease4& other) + : Lease(other.addr_, other.t1_, other.t2_, other.valid_lft_, + other.subnet_id_, other.cltt_), ext_(other.ext_), + hwaddr_(other.hwaddr_) { + + fixed_ = other.fixed_; + fqdn_fwd_ = other.fqdn_fwd_; + fqdn_rev_ = other.fqdn_rev_; + hostname_ = other.hostname_; + comments_ = other.comments_; + + if (other.client_id_) { + client_id_.reset(new ClientId(other.client_id_->getClientId())); + + } else { + client_id_.reset(); + + } +} + +Lease4& +Lease4::operator=(const Lease4& other) { + if (this != &other) { + addr_ = other.addr_; + t1_ = other.t1_; + t2_ = other.t2_; + valid_lft_ = other.valid_lft_; + cltt_ = other.cltt_; + subnet_id_ = other.subnet_id_; + fixed_ = other.fixed_; + hostname_ = other.hostname_; + fqdn_fwd_ = other.fqdn_fwd_; + fqdn_rev_ = other.fqdn_rev_; + comments_ = other.comments_; + ext_ = other.ext_; + hwaddr_ = other.hwaddr_; + + if (other.client_id_) { + client_id_.reset(new ClientId(other.client_id_->getClientId())); + } else { + client_id_.reset(); + } + } + return (*this); +} + Lease6::Lease6(LeaseType type, const isc::asiolink::IOAddress& addr, DuidPtr duid, uint32_t iaid, uint32_t preferred, uint32_t valid, uint32_t t1, uint32_t t2, SubnetID subnet_id, uint8_t prefixlen) |