v0.3.0 - restart on newly-appeared IPv4 subnet (FR-40)
Restart on a newly-appeared IPv4 subnet (FR-40)
dynavlan now restarts the nominated RESTART_SNAPS/RESTART_SERVICES whenever a new global-IPv4 subnet appears on any interface, not only on a tagged-VLAN change. This closes two gaps:
- An access port or native-only trunk that leases after boot (no tagged VLAN, so nothing was changing before).
- The monitoring agent starting before the base interface finishes DHCP at boot (dynavlan's boot run is deliberately not ordered after
network-online.target).
Both are the same underlying problem: the agent cares about IPv4 subnets it can scan, not VLAN tags.
Behavior
- New pure helper
ipv4_networkkeys subnet tokens on the network address, not the host address, so a same-pool DHCP renewal never restarts. - A monotonic per-uptime seen-set at
/run/dynavlan/seen(wiped on reboot): a flap back onto an already-seen subnet doesn't restart; an empty seen-set at boot restarts once after settle regardless of boot-vs-DHCP ordering. - At most one restart per run, deduped against any VLAN-driven restart.
--dry-run/--statusreport the would-restart delta without restarting or writing the seen-set.apply_change(the accept/rollback chain) is unchanged; the growth-check is an additive post-step inmain.
Config
- New key
RESTART_ON_NEW_SUBNET(defaulttrue). No-op when no restart targets are configured.
Validation
- Unit suite 139/0; per-task, architect, and whole-branch reviews clean.
- Hardware-validated on a Protectli box with the real Domotz snap: access-port and boot-race restarts, same-subnet/flap/disappearance no-restart, and read-only
--dry-run/--status, across UniFi and Meraki.
Full detail in CHANGELOG.md and docs/dynavlan-PRD.md (FR-40).