Changes since 4.0.0
+- It's now possible to update the "ends" field of a lease with OMAPI.
+ This is useful if you want not only to release a lease, but also make
+ it available for reuse right away. Hat tip to Christof Chen.
+
- Fixed "--version" flag in dhcrelay
- The warning logged when an address range doesn't fit in the subnets
} else if (!omapi_ds_strcmp (name, "starts")) {
return ISC_R_NOPERM;
} else if (!omapi_ds_strcmp (name, "ends")) {
- return ISC_R_NOPERM;
+ unsigned long lease_end, old_lease_end;
+ status = omapi_get_int_value (&lease_end, value);
+ if (status != ISC_R_SUCCESS)
+ return status;
+ old_lease_end = lease->ends;
+ lease->ends = lease_end;
+ if (supersede_lease (lease, 0, 1, 1, 1)) {
+ log_info ("lease %s end changed from %lu to %lu",
+ piaddr(lease->ip_addr), old_lease_end, lease_end);
+ return ISC_R_SUCCESS;
+ }
+ log_info ("lease %s end change from %lu to %lu failed",
+ piaddr(lease->ip_addr), old_lease_end, lease_end);
+ return ISC_R_IOERROR;
} else if (!omapi_ds_strcmp(name, "flags")) {
u_int8_t oldflags;