Skip to content

fix(daemon): choose iface once, then only watch the link - #7

Merged
keskad merged 1 commit into
mainfrom
fix/simplify-daemon-link-watch
Aug 26, 2026
Merged

fix(daemon): choose iface once, then only watch the link#7
keskad merged 1 commit into
mainfrom
fix/simplify-daemon-link-watch

Conversation

@keskad

@keskad keskad commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Stops the ~96s network restart loop by cutting concurrent decision loops down to one state machine.

After apply, micronet holds the chosen interface and mode. It no longer re-probes DHCP every 15s, yields to client, or re-applies on carrier blips. Unplug waits linkRetrySecs (JSON, default 15) then one full re-select. JSON reload / reconfigure also re-select.

Health is owned by the daemon: micronet check reads IPC healthy. No carrier is healthy. Missing dnsmasq/dhclient is restarted in place. Unhealthy only after 3 failed ticks (~9s), with the reason in microinit logs network.

Apply no longer admin-ups ifaces that already have carrier, skips ethtool when the link is already up, and keeps gateway.ip if already assigned.

Trade-off: a foreign DHCP server that appears without a link break is not detected until the next select (start, unplug longer than linkRetrySecs, or reconfigure). Power the router first, or unplug/replug the hub cable after it is up.

cargo test -p micronet and cargo clippy --all-targets -- -D warnings pass locally.

Stop the ~96s microinit restart loop. Drop periodic DHCP recheck,
yield-to-client, ProbePolicy, and the carrier-loss watchdog.

After apply, micronet holds the chosen interface. Unplug waits
linkRetrySecs (default 15) then one full re-select. Health lives
on the daemon (self-heal dnsmasq/dhclient, 3-tick hysteresis);
micronet check reads IPC instead of probing live.

Do not admin-up ifaces that already have carrier; skip ethtool
when the link is already up; keep gateway.ip if already assigned.

Co-authored-by: Cursor <cursoragent@cursor.com>
@keskad
keskad merged commit 15a7066 into main Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant