}
}
+ // Remove existing DNS entries for the lease, if any.
+ // queueNCR will do the necessary checks and will skip the update, if not needed.
+ queueNCR(CHG_REMOVE, lease);
+
// @todo: Call hooks.
// We need to disassociate the lease from the client. Once we move a lease
LeaseMgrFactory::instance().updateLease4(lease);
- // Remove existing DNS entries for the lease, if any.
- // queueNCR will do the necessary checks and will skip the update, if not needed.
- queueNCR(CHG_REMOVE, lease);
-
// Bump up the statistics.
// Per subnet declined addresses counter.
}
}
+ // Check if a lease has flags indicating that the FQDN update has
+ // been performed. If so, create NameChangeRequest which removes
+ // the entries. This method does all necessary checks.
+ queueNCR(CHG_REMOVE, lease);
+
// @todo: Call hooks.
// We need to disassociate the lease from the client. Once we move a lease
LeaseMgrFactory::instance().updateLease6(lease);
- // Check if a lease has flags indicating that the FQDN update has
- // been performed. If so, create NameChangeRequest which removes
- // the entries. This method does all necessary checks.
- queueNCR(CHG_REMOVE, lease);
-
// Bump up the subnet-specific statistic.
StatsMgr::instance().addValue(
StatsMgr::generateName("subnet", lease->subnet_id_, "declined-addresses"),
// Remove this lease from LeaseMgr as it is reserved to someone
// else or doesn't belong to a pool.
- bool success = LeaseMgrFactory::instance().deleteLease(candidate);
-
- if (!success) {
+ if (!LeaseMgrFactory::instance().deleteLease(candidate)) {
continue;
}
}
// Remove this lease from LeaseMgr as it doesn't belong to a pool.
- bool success = LeaseMgrFactory::instance().deleteLease(candidate);
-
- if (!success) {
+ if (!LeaseMgrFactory::instance().deleteLease(candidate)) {
continue;
}
// simply remove it from the list.
// We have reservations, but not for this lease. Release it.
// Remove this lease from LeaseMgr
- bool success = LeaseMgrFactory::instance().deleteLease(*lease);
-
- if (!success) {
+ if (!LeaseMgrFactory::instance().deleteLease(*lease)) {
continue;
}
// Oh dear, the lease is no longer valid. We need to get rid of it.
// Remove this lease from LeaseMgr
- bool success = LeaseMgrFactory::instance().deleteLease(lease);
-
- if (!success) {
+ if (!LeaseMgrFactory::instance().deleteLease(lease)) {
return;
}
.arg(ctx.query_->getLabel())
.arg(client_lease->addr_.toText());
- bool success = lease_mgr.deleteLease(client_lease);
-
- if (success) {
+ if (lease_mgr.deleteLease(client_lease)) {
// Need to decrease statistic for assigned addresses.
StatsMgr::instance().addValue(
StatsMgr::generateName("subnet", client_lease->subnet_id_,
// See how many rows were affected. Note that the statement may delete
// multiple rows.
- int affected_rows = mysql_stmt_affected_rows(ctx->conn_.statements_[stindex]);
-
- return (static_cast<uint64_t>(affected_rows));
+ return (static_cast<uint64_t>(mysql_stmt_affected_rows(ctx->conn_.statements_[stindex])));
}
bool