Reservation lease time; reservations by MAC address or client ID

- A reservation can have its own lease time (--lease-time, the
  reservation dialog), over the subnet's. Schema migration 6.
- A reservation with a MAC address and a client ID matches either one
  (a dual-boot machine sends two client IDs from one MAC); before, it
  was found by MAC and then refused. A lease of the reserved address by
  the client's other identity counts as its own.
- The Leases page shows a client's client ID; reserving a lease uses
  both, or one with --by / the dialog's choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
abrown38andClaude Opus 5.5 committed 2026-10-18 20:26:24 +01:00
1 parent abb2ee0fd7
commit 4fd72998ec
20 files changed
+252 -65

No files matched your search

+5 -1
View File
@@ -261,13 +261,17 @@ func Mask(p netip.Prefix) netip.Addr {
// MAC address, or by its client identifier (option 61) when ClientID is
// set. The subnet is the one whose prefix holds the address.
type Reservation struct {
ID int64 `json:"id"`
ID int64 `json:"id"`
// The client is known by its MAC address, its client identifier
// (option 61), or either when both are set.
MAC string `json:"mac,omitempty"`
ClientID string `json:"client_id,omitempty"`
IP netip.Addr `json:"ip"`
// Hostname is sent to the client (option 12).
Hostname string `json:"hostname"`
Options []OptionValue `json:"options"`
// LeaseTime overrides the subnet's lease time (0: inherit).
LeaseTime int `json:"lease_time,omitempty"`
// Disabled reservations are kept but ignored: the client is treated
// like any other, and an address inside a pool may go to others.
Disabled bool `json:"disabled"`