ml_wg_mgr: don't pre-install unvalidated peer endpoints — DERP until DISCO validates - #21
Open
snowpaper wants to merge 1 commit into
Open
ml_wg_mgr: don't pre-install unvalidated peer endpoints — DERP until DISCO validates#21snowpaper wants to merge 1 commit into
snowpaper wants to merge 1 commit into
Conversation
snowpaper
force-pushed
the
fix/no-unvalidated-endpoints
branch
from
July 9, 2026 04:56
d8258bc to
1397fcf
Compare
…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 CamM2325#18
snowpaper
force-pushed
the
fix/no-unvalidated-endpoints
branch
from
July 9, 2026 04:57
1397fcf to
da55beb
Compare
fudio101
referenced
this pull request
in fugo101/microlink
Aug 14, 2026
Absorb upstream #21: don't pre-install unvalidated peer endpoints
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.
Fixes #18.
At peer-add, the peer's advertised
endpoints[0]from the MapResponse was installed as the WireGuard endpoint before any path validation, andwireguardif's output path treats any non-zero endpoint as a working direct path. For a CGNAT peer (cellular hotspot) that address is unreachable — no hole was ever punched — so the tunnel went one-way: inbound arrived via DERP while every outbound data packet went direct-UDP into a black hole (device trace: inboundvia_derp=1, DERP TX carried zerohdr=04data frames).Fix follows Tailscale's own semantics — data via DERP until a direct path is validated by a DISCO pong: leave the endpoint blank at peer-add. The only endpoint installs are now the already-correctly-gated ones (
process_disco_pongon a direct pong, and the handshake path gated onbest_ip). Same-LAN peers still upgrade to direct within seconds because the direct pong validates immediately.Verified on hardware (ESP32-S3 N16R8, ESP-IDF v5.3): a CGNAT peer that previously could never reach a TCP service on the node (ping timeout, connect fail, despite the node showing active) gets ping replies over DERP, TCP connects, and bulk transfers complete end-to-end. Same-LAN direct path validated unaffected the same day. CRLF line endings preserved.