fix(dhcp): release an address before another reservation takes it
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 1m25s
driver / test (3.13) (pull_request) Successful in 1m13s
driver / lowest (pull_request) Successful in 45s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m10s
CI / driver (pull_request) Successful in 3m6s
driver / publish (pull_request) Skipped
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 1m25s
driver / test (3.13) (pull_request) Successful in 1m13s
driver / lowest (pull_request) Successful in 45s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m10s
CI / driver (pull_request) Successful in 3m6s
driver / publish (pull_request) Skipped
apply_dhcp_reservationset wrote adds first, then updates in the order of the desired set. Kea keeps addresses unique at each write, so when an address moved from one reservation to another, the reservation taking it was refused as a duplicate whenever it came first. The changes are now ordered (_dhcp_order): an update that moves a reservation off its address goes before the change that takes that address, along a chain from its free end, and adds come after every update. A swap or rotation of addresses has no such order; its changes are still tried, so a server that checks only at the commit takes them, and a refused one's [failed] line says it was a swap and with which reservations. Nothing is moved to a temporary address: the contract knows no free one, and a failed second write would leave it there. The diff is computed against one read of the reservations, shared with diff_dhcp_reservations. Refused rows still do not stop the others, the rest is committed and DhcpApplyError follows, as since 4.35.1. Closes #106
This commit is contained in:
1 parent
5258a43dc9
commit
b4cdcfd347
7 files changed
+347
-43
No files matched your search
@@ -493,7 +493,10 @@ The same split applies to `DhcpServerMixin`: `get_dhcp_reservations`/
|
||||
`apply_dhcp_reservation`/`commit_dhcp_reservations` are abstract (Kea REST on
|
||||
OPNsense, dnsmasq/odhcpd UCI on OpenWrt), while `diff_dhcp_reservations` and
|
||||
`apply_dhcp_reservationset` are concrete — matching by normalised MAC and the
|
||||
apply-then-commit orchestration are identical for every DHCP server.
|
||||
apply-then-commit orchestration are identical for every DHCP server. The apply writes
|
||||
its changes so an address is released before another reservation takes it (an update
|
||||
that frees an address first, adds last); a swap of addresses has no such order and is
|
||||
reported as one where the server refuses it.
|
||||
|
||||
A new driver (FortiGate, pfSense, …) gets `diff_firewall_rules`/
|
||||
`apply_firewall_ruleset` for free the moment it implements the three abstract
|
||||
|
||||
Reference in new issue
Block a user