+2260. [bug] razvan
+ Fixed a bug which was causing the allocation engine to reject the
+ lease if a data race caused by a different server updating the
+ shared database entries was detected. The entire packet is now
+ dropped in this particular case. This applies to both kea-dhp4
+ and kea-dhcp6 servers.
+ (Gitlab #3798, #3648)
+
2259. [bug] marcin
Prevent the clients from declining expired or released leases.
Only a valid lease assigned to the declining client can now
#include <dhcpsrv/alloc_engine.h>
#include <dhcpsrv/alloc_engine_log.h>
#include <dhcpsrv/cfgmgr.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/dhcpsrv_log.h>
#include <dhcpsrv/host_mgr.h>
#include <dhcpsrv/host.h>
return (leases);
}
+ } catch (const NoSuchLease& e) {
+ isc_throw(NoSuchLease, "detected data race in AllocEngine::allocateLeases6: " << e.what());
+
} catch (const isc::Exception& e) {
// Some other error, return an empty lease.
return (leases);
+ } catch (const NoSuchLease& e) {
+ isc_throw(NoSuchLease, "detected data race in AllocEngine::renewLeases6: " << e.what());
+
} catch (const isc::Exception& e) {
// Some other error, return an empty lease.
ctx.new_lease_ = requestLease4(ctx);
}
+ } catch (const NoSuchLease& e) {
+ isc_throw(NoSuchLease, "detected data race in AllocEngine::allocateLease4: " << e.what());
+
} catch (const isc::Exception& e) {
// Some other error, return an empty lease.
LOG_ERROR(alloc_engine_logger, ALLOC_ENGINE_V4_ALLOC_ERROR)
((*lease_it)->valid_lft_ != lease->current_valid_lft_))) {
// For test purpose only: check that the lease has not changed in
// the database.
- isc_throw(NoSuchLease, "failed to update the lease with address "
- << lease->addr_ << " - lease has changed in database");
+ isc_throw(NoSuchLease, "unable to update lease for address " <<
+ lease->addr_.toText() << " either because the lease does not exist, "
+ "it has been deleted or it has changed in the database.");
}
// Try to write a lease to disk first. If this fails, the lease will
((*lease_it)->valid_lft_ != lease->current_valid_lft_))) {
// For test purpose only: check that the lease has not changed in
// the database.
- isc_throw(NoSuchLease, "failed to update the lease with address "
- << lease->addr_ << " - lease has changed in database");
+ isc_throw(NoSuchLease, "unable to update lease for address " <<
+ lease->addr_.toText() << " either because the lease does not exist, "
+ "it has been deleted or it has changed in the database.");
}
// Try to write a lease to disk first. If this fails, the lease will
// If no rows affected, lease doesn't exist.
if (affected_rows == 0) {
isc_throw(NoSuchLease, "unable to update lease for address " <<
- lease->addr_.toText() << " as it does not exist");
+ lease->addr_.toText() << " either because the lease does not exist, "
+ "it has been deleted or it has changed in the database.");
}
// Should not happen - primary key constraint should only have selected
// If no rows affected, lease doesn't exist.
if (affected_rows == 0) {
isc_throw(NoSuchLease, "unable to update lease for address " <<
- lease->addr_.toText() << " as it does not exist");
+ lease->addr_.toText() << " either because the lease does not exist, "
+ "it has been deleted or it has changed in the database.");
}
// Should not happen - primary key constraint should only have selected