Kea reservations are matched by IP only: create overwrites a foreign reservation, delete removes one for another MAC #26

Closed
opened 2026-10-20 22:26:49 +00:00 by christianmanivong · 0 comments
Owner

Priority: P3 (important, not urgent).

  • create_dhcp_reservation looks up an existing reservation by ip_address only (napalm_opnsense/opnsense.py, the searchReservation loop). If a reservation for that IP belongs to another MAC — e.g. made by hand — the driver overwrites it with the new MAC and replaces its description with [netork], without a warning.
  • delete_dhcp_reservation_and_lease(mac, ip) also matches on IP only and ignores mac. After an address was reused or edited by hand it deletes the reservation of a different host.

Fix: match on IP and MAC (normalised with napalm_device_types.dhcp.normalize_mac). On create, an IP held by another MAC should raise (the caller decides) instead of taking it over; on delete, a reservation for the IP with another MAC is left alone and reported.

Found during netOrk issue NetOrk/netork#1187 (2026-10-21).

**Priority: P3** (important, not urgent). - `create_dhcp_reservation` looks up an existing reservation by `ip_address` only (`napalm_opnsense/opnsense.py`, the `searchReservation` loop). If a reservation for that IP belongs to another MAC — e.g. made by hand — the driver overwrites it with the new MAC and replaces its description with `[netork]`, without a warning. - `delete_dhcp_reservation_and_lease(mac, ip)` also matches on IP only and ignores `mac`. After an address was reused or edited by hand it deletes the reservation of a different host. **Fix:** match on IP *and* MAC (normalised with `napalm_device_types.dhcp.normalize_mac`). On create, an IP held by another MAC should raise (the caller decides) instead of taking it over; on delete, a reservation for the IP with another MAC is left alone and reported. Found during netOrk issue NetOrk/netork#1187 (2026-10-21).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-opnsense#26