Skip to content

cli: add local route-table fallback for public IP detection#2963

Open
ben-dz wants to merge 1 commit intomainfrom
bdz/doublezero-2962
Open

cli: add local route-table fallback for public IP detection#2963
ben-dz wants to merge 1 commit intomainfrom
bdz/doublezero-2962

Conversation

@ben-dz
Copy link
Contributor

@ben-dz ben-dz commented Feb 13, 2026

Resolves: #2962

Summary of Changes

  • Add is_public_ipv4() that rejects all IANA-reserved, private, loopback, link-local, CGNAT, documentation/test, multicast, and reserved ranges — equivalent to nightly
    Ipv4Addr::is_global()
  • Add local route-table fallback (get_public_ipv4_via_route()) so public IP detection works when ifconfig.me is unreachable
  • Refactor get_public_ipv4() to try HTTP first, then fall back to the routing-table approach with the new address validation

Testing Verification

  • Comprehensive unit tests covering every rejected range with boundary checks (just-below and just-above each CIDR block)
  • rust-test, rust-build, rust-lint all passing in CI

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.

client: add local route-table fallback for public IP detection

1 participant

Comments