tailscale/ipn
Brad Fitzpatrick ff1c7ef23c ipn/ipnlocal,net/routemanager: keep a routemanager.RouteManager updated per node
Give nodeBackend a RouteManager and keep it in sync as routing
inputs change: full netmaps resync the whole peer set (removals plus
no-op-cheap upserts), incremental netmap deltas mirror their peer
upserts and removes into the same mutation batch, and
authReconfigLocked pushes the routing-relevant prefs (exit node,
subnet route acceptance, OneCGNAT) after resolving the exit node's
stable ID to its current numeric node ID.

A selected exit node that doesn't resolve to a current peer (a
nonexistent node, or MDM's "auto:any" placeholder awaiting
resolution) is not the same as no exit node: per the long-standing
ipn.Prefs.ExitNodeID contract, it blackholes internet traffic rather
than letting it escape to the local network. RouteManager's Prefs
gains an ExitNodeSelected bit so its OS route set keeps the default
routes in that case, with no outbound peer to carry them, matching
what routerConfigLocked does today, as pinned by TestRouterConfigExitNodeBlackhole in the previous commit.

All mutations happen with nodeBackend.mu held, satisfying the
RouteManager's serialized Begin/Commit contract.

Nothing consumes its snapshots yet; the wgengine data plane and OS
router wiring come next.

Updates #12542

Change-Id: I677b6b2c9efb8e41b3d27071bd9db73e01640d3b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-07-13 10:20:54 -07:00
..
auditlog all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
conffile cmd/tailscale/cli, ipn/conffile: accept legacy serve config in set-config (#20056) 2026-06-12 18:52:17 -07:00
desktop all: don't repeat the the word "the" unnecessarily 2026-06-18 16:32:08 +01:00
ipnauth all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipnext ipn/ipnext, feature/routecheck: subscribe routecheck to the IPN bus 2026-07-02 20:26:27 -07:00
ipnlocal ipn/ipnlocal,net/routemanager: keep a routemanager.RouteManager updated per node 2026-07-13 10:20:54 -07:00
ipnserver ipn/ipnlocal: consolidate test-only LocalBackend methods behind ForTest 2026-06-27 16:11:42 -07:00
ipnstate all: fix typos where we repeat repeat ourselves 2026-07-03 16:09:03 +01:00
lapitest ipn/ipnlocal: consolidate test-only LocalBackend methods behind ForTest 2026-06-27 16:11:42 -07:00
localapi ipn/localapi,client/local: honour Retry-After on cert rate-limit (#20315) 2026-07-08 13:34:40 +01:00
policy all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
store all: fix typos where we repeat repeat ourselves 2026-07-03 16:09:03 +01:00
backend_test.go ipn: add fmt.Stringer support to NotifyWatchOpt (#20072) 2026-06-18 10:27:16 -07:00
backend.go ipn/{ipn,ipnlocal}: add per-user policy snapshots to IPN bus (#20135) 2026-06-30 12:44:29 -07:00
conf_test.go ipn/config: add RelayServerPort and RelayServerStaticEndpoints to config file (#18300) 2026-06-26 15:45:29 -05:00
conf.go ipn/conf: add ConfigVAlpha.AdvertiseExitNode 2026-07-10 07:24:03 -07:00
doc.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipn_clone.go cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
ipn_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipn_view.go cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
prefs_test.go cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
prefs.go cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
serve_expand_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
serve_test.go ipn,ipn/localapi: require local admin to serve Unix domain sockets 2026-06-03 09:45:02 -06:00
serve.go ipn,ipn/localapi: require local admin to serve Unix domain sockets 2026-06-03 09:45:02 -06:00
store_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
store.go ipn/store: make WriteState(id, nil) delete key instead of adding nil entry (#19920) 2026-05-29 11:22:14 -07:00