mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 06:25:34 +00:00
[#1065] addressed review
This commit is contained in:
@@ -607,8 +607,8 @@ namespace { // anonymous namespace.
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
addOrUpdate4(Lease4Ptr lease, bool force_create) {
|
addOrUpdate4(Lease4Ptr lease, bool force_create) {
|
||||||
Lease4Ptr lease4 = LeaseMgrFactory::instance().getLease4(lease->addr_);
|
Lease4Ptr existing = LeaseMgrFactory::instance().getLease4(lease->addr_);
|
||||||
if (force_create && !lease4) {
|
if (force_create && !existing) {
|
||||||
// lease does not exist
|
// lease does not exist
|
||||||
if (!LeaseMgrFactory::instance().addLease(lease)) {
|
if (!LeaseMgrFactory::instance().addLease(lease)) {
|
||||||
isc_throw(db::DuplicateEntry,
|
isc_throw(db::DuplicateEntry,
|
||||||
@@ -618,15 +618,15 @@ addOrUpdate4(Lease4Ptr lease, bool force_create) {
|
|||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
LeaseMgrFactory::instance().updateLease4(lease);
|
LeaseMgrFactory::instance().updateLease4(lease);
|
||||||
LeaseCmdsImpl::updateStatsOnUpdate(lease4, lease);
|
LeaseCmdsImpl::updateStatsOnUpdate(existing, lease);
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
addOrUpdate6(Lease6Ptr lease, bool force_create) {
|
addOrUpdate6(Lease6Ptr lease, bool force_create) {
|
||||||
Lease6Ptr lease6 =
|
Lease6Ptr existing =
|
||||||
LeaseMgrFactory::instance().getLease6(lease->type_, lease->addr_);
|
LeaseMgrFactory::instance().getLease6(lease->type_, lease->addr_);
|
||||||
if (force_create && !lease6) {
|
if (force_create && !existing) {
|
||||||
// lease does not exist
|
// lease does not exist
|
||||||
if (!LeaseMgrFactory::instance().addLease(lease)) {
|
if (!LeaseMgrFactory::instance().addLease(lease)) {
|
||||||
isc_throw(db::DuplicateEntry,
|
isc_throw(db::DuplicateEntry,
|
||||||
@@ -636,7 +636,7 @@ addOrUpdate6(Lease6Ptr lease, bool force_create) {
|
|||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
LeaseMgrFactory::instance().updateLease6(lease);
|
LeaseMgrFactory::instance().updateLease6(lease);
|
||||||
LeaseCmdsImpl::updateStatsOnUpdate(lease6, lease);
|
LeaseCmdsImpl::updateStatsOnUpdate(existing, lease);
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user