Absorb upstream #21: don't pre-install unvalidated peer endpoints - #4
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picks
da55beb7from CamM2325/microlink#21 by @snowpaper (fixes CamM2325/microlink#18), unchanged aside from a provenance trailer. Author attribution preserved viagit 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 forlilygo-t-display-s3(ESP-IDF 6.0.1) in the downstream ZenClock project. SeeUPSTREAM_PRS.md(added in a follow-up) for the full absorption record.