Skip to content

Isolate unused Ethernet and re-pick on carrier loss - #6

Merged
keskad merged 1 commit into
mainfrom
fix/cold-boot-carrier-isolate
Aug 26, 2026
Merged

Isolate unused Ethernet and re-pick on carrier loss#6
keskad merged 1 commit into
mainfrom
fix/cold-boot-carrier-isolate

Conversation

@keskad

@keskad keskad commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Cold boot was putting .1 on unplugged eth0 (2s carrier wait), then eth1 pinged that local .1 and became static .252.
  • micronet now owns every cable Ethernet: pick one with carrier (wait ≤5s), admin-down and flush the rest, and treat gateway.ip as reachable only if it is not already a local inet.
  • Auto iface: if the chosen link has no carrier for 10s, full re-apply (covers cable moves and late USB enumeration); 30s backoff when nothing is plugged in.

Test plan

  • cargo test -p micronet / cargo clippy --workspace --all-targets -- -D warnings
  • Cold boot: USB eth1 cabled, onboard eth0 empty → micronet status gateway on eth1 .1/24; eth0 is DOWN with no address
  • Unplug eth1, plug eth0 → within ~10–15s status moves to eth0, eth1 is down
  • LAN with foreign DHCP → client; LAN with router .1 and no DHCP → static (no rogue dnsmasq)

Made with Cursor

Cold boot was assigning .1 to unplugged eth0 (2s carrier wait) then
treating that local .1 as a foreign gateway on eth1. micronet now owns
every cable iface: one up, the rest down, with a 10s carrier-loss re-apply.

Co-authored-by: Cursor <cursoragent@cursor.com>
@keskad
keskad merged commit 4a57e17 into main Aug 26, 2026
@keskad
keskad deleted the fix/cold-boot-carrier-isolate branch August 26, 2026 16:07
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