Skip to content

net: clean stale state after WAN protocol switches - #141

Merged
Cd1s merged 10 commits into
mainfrom
fix/wan-proto-switch
Oct 17, 2026
Merged

Cd1s merged 10 commits into
mainfrom
fix/wan-proto-switch

Conversation

@Cd1s

@Cd1s Cd1s commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

What

  • Ignore delayed PPP events unless the current WAN is still PPPoE on the same interface.
  • Retire removed, renamed, protocol-switched, or disabled WAN IPv6 prefixes through the existing RFC 9096 renumber flow, while preserving temporary DHCPv6 release state.
  • Preserve the previous prefix owner across pre-commit dhcpcd hooks; commit cleanup compares the recorded old L3 interface with the new WAN interface.
  • Defer irreversible IPv6 runtime cleanup until apply verification and confirmation are complete, so rollback does not lose the prior state.
  • Remove obsolete VLAN links only when they carry the mini-router link alias; preserve unmarked user or legacy interfaces.
  • Restore cleared hardware MACs only from valid nonzero unicast ethtool output and preserve the original link UP/DOWN state.
  • Add ethtool to installer/factory packages, fix the net documentation table, and add regression tests for real hook/apply paths and cleanup edge cases.

Why

Switching a WAN from PPPoE to DHCP/static could delete the new WAN lease, routes, and DNS state. Removed IPv6 PD prefixes could remain advertised, while VLAN interfaces and cloned MACs survived configuration changes. Runtime dhcpcd hooks during a protocol switch also must not overwrite the old prefix owner before the apply is committed.

Verification

  • gofmt -l .
  • go vet ./...
  • go test -count=1 ./...
  • sh tools/ci.sh — ALL CHECKS PASSED
  • Clean origin/main sh tools/ci.sh — passed

Closes #140

@Cd1s
Cd1s merged commit 7b5c03e into main Oct 17, 2026
2 checks passed
@Cd1s Cd1s mentioned this pull request Oct 18, 2026
52 tasks done
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.

net: clean stale state after WAN protocol switches

1 participant