Commit 1d6a2e3f authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[2697] Lease4::operator== is now safe to use for leases without client-id

parent 530f569e
......@@ -113,11 +113,22 @@ Lease4::toText() const {
bool
Lease4::operator==(const Lease4& other) const {
if ( (client_id_ && !other.client_id_) ||
(!client_id_ && other.client_id_) ) {
// One lease has client-id, but the other doesn't
return false;
}
if (client_id_ && other.client_id_ &&
*client_id_ != *other.client_id_) {
// Different client-ids
return false;
}
return (
addr_ == other.addr_ &&
ext_ == other.ext_ &&
hwaddr_ == other.hwaddr_ &&
*client_id_ == *other.client_id_ &&
t1_ == other.t1_ &&
t2_ == other.t2_ &&
valid_lft_ == other.valid_lft_ &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment