Files
flutter-tsnet/ios/Go/netmon_route_darwin.go
Mathias Beaulieu-Duncan ca3a8b6298 0.6.0: recover-paths tier + in-plugin NWPathMonitor (item 90 deafness)
The deep dive (constellation-docs research/tsnet-deafness-deep-dive.md)
established the embedded node goes deaf because a zombie home-DERP
connection is only detected by the 120 s read deadline and the Rebind/
ReSTUN repair machinery runs solely on netmon events an embedding never
receives. TailscaleRecoverPaths() runs SetNetworkUp + Rebind + ReSTUN on
the running node (3 s DERP probe bound; holds the node lock because
Conn.Rebind has no closed-conn fence upstream, unlike the LocalClient
paths), and the Swift layer now feeds real NWPathMonitor transitions into
netmon exactly as the official Apple client does, so the repair machinery
finally runs on network changes. The TailscalePingPeer docs no longer
claim a disco ping re-registers DERP: it is a detector, not a cure.
Opt-in debugNetLogging start flag (envknob; compiled out of GOOS=ios by
upstream, effective on desktop/Android bench builds). Go suite 29/29
under -race, Dart 13/13, both xcframework slices export the new symbols.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 14:45:35 -04:00

21 lines
848 B
Go

//go:build darwin || ios
package main
import "tailscale.com/net/netmon"
// updateDefaultRouteInterface pushes the OS-observed default-route
// interface name into netmon's package-level cache
// (tailscale.com/net/netmon/defaultroute_darwin.go), which Apple builds
// consult before falling back to the AF_ROUTE guess. Tailscale's own
// Apple clients feed this from an NWPathMonitor in Swift (upstream PR
// #10680) because passive route monitoring is unreliable inside app
// processes; our embedding does the same via
// TailscaleUpdateDefaultRouteInterface. Package-level state: safe to
// call whether or not the node is running (an empty name is an upstream
// no-op), and the freshest value simply wins the next default-route
// lookup.
func updateDefaultRouteInterface(name string) {
netmon.UpdateLastKnownDefaultRouteInterface(name)
}