Skip to content

android: fall back to IPv6 when pinging a peer - #910

Open
PaarthShah wants to merge 1 commit into
tailscale:mainfrom
PaarthShah:ping-ipv6-fallback
Open

PaarthShah wants to merge 1 commit into
tailscale:mainfrom
PaarthShah:ping-ipv6-fallback

Conversation

@PaarthShah

@PaarthShah PaarthShah commented Nov 2, 2026 •

Copy link
Copy Markdown

Fixes tailscale/tailscale#22125

In an IPv6-only tailnet (via using disableIPv4), the ping view never works. Client.ping only used the peer's primary IPv4 address, and when there isn't one it fails immediately with "No IP address for peer" without ever reaching the LocalAPI. The user sees "An unknown error occurred. Please try again."

Fall back to the peer's primary IPv6 address, as PeerView already does for the peer's subtitle. IPv4 is still preferred when present. The LocalAPI ping handler parses the address with netip.ParseAddr, so IPv6 needs no other changes.

Testing

  • Added ClientTest cases that capture the LocalAPI path: dual-stack peers still ping IPv4; IPv6-only peers now ping IPv6. The IPv6 case fails without the fix (ping is never sent).
  • make tailscale-debug (gradlew test assembleDebug) in the repo's build image: all 88 unit tests pass and the debug APK builds.
  • Not yet tested on a device.

🤖 Generated with Claude Code

Client.ping only used the peer's primary IPv4 address and failed with
"No IP address for peer" when there wasn't one, so the ping view never
worked in IPv6-only tailnets. Fall back to the primary IPv6 address,
as PeerView already does for the peer's subtitle.

Fixes tailscale/tailscale#22125

Signed-off-by: Paarth Shah <mail@shahpaarth.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

android: ping view fails for peers without an IPv4 address (IPv6-only tailnets)

1 participant