Skip to content

Absorb upstream #21: don't pre-install unvalidated peer endpoints - #4

Merged
fudio101 merged 1 commit into
mainfrom
fix/wg-no-unvalidated-endpoints
Aug 14, 2026
Merged

Absorb upstream #21: don't pre-install unvalidated peer endpoints#4
fudio101 merged 1 commit into
mainfrom
fix/wg-no-unvalidated-endpoints

Conversation

@fudio101

Copy link
Copy Markdown
Collaborator

Cherry-picks da55beb7 from CamM2325/microlink#21 by @snowpaper (fixes CamM2325/microlink#18), unchanged aside from a provenance trailer. Author attribution preserved via git cherry-pick -x.

Why we're absorbing this ourselves: upstream has had zero maintainer activity (no comments, no reviews) on any open PR since the last commit on 2026-03-17. Six PRs are open and unreviewed; this is one of three we're pulling in because they're clean, well-verified fixes.

What it fixes: at peer-add, the peer's advertised endpoint (unvalidated) was installed as the WireGuard endpoint, and wireguardif's output path treats any non-zero endpoint as a working direct path. For a CGNAT peer (e.g. phone on cellular) that address is unreachable — the tunnel goes one-way: inbound via DERP, every outbound packet into a black hole. Fix follows Tailscale's own semantics: leave the endpoint blank until a DISCO pong validates a direct path.

Applied cleanly (git apply --check) against our diverged fork. Built clean for lilygo-t-display-s3 (ESP-IDF 6.0.1) in the downstream ZenClock project. See UPSTREAM_PRS.md (added in a follow-up) for the full absorption record.

…DISCO validates

At peer-add, the peer's advertised endpoints[0] from the MapResponse was
installed as the WireGuard endpoint before any path validation, and
wireguardif's output path treats any non-zero endpoint as a working
direct path. For a CGNAT peer (e.g. cellular hotspot) that address is
unreachable, so the tunnel went one-way: inbound arrived via DERP while
every outbound data packet was sent direct-UDP into a black hole.

Tailscale semantics: data flows via DERP until a direct path is
validated by a DISCO pong. Leave the endpoint blank at peer-add; the
only endpoint installs are the already-gated ones (process_disco_pong on
a direct pong, and the handshake path gated on best_ip). Same-LAN peers
still upgrade to direct within seconds.

Verified on ESP32-S3 (ESP-IDF v5.3): a CGNAT peer that previously could
never reach a TCP service on the node (ping timeout, connect fail)
gets ping replies over DERP, TCP connects, and bulk transfers complete.
Same-LAN direct path unaffected.

Fixes #18

(cherry picked from commit da55beb)
Upstream-PR: CamM2325#21
Upstream-Issue: CamM2325#18
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.

Unvalidated advertised endpoints installed at peer-add — one-way tunnel with CGNAT peers

2 participants