tailscale/ipn
Mike O'Driscoll 6a709216b9
ipn/ipnlocal,wgengine/magicsock: re-report NetInfo to new control client (#20025)
magicsock de-duplicates NetInfo callbacks against c.netInfoLast, a cache
that lives on the long-lived magicsock.Conn. That cache survives a control
client swap (interactive login or profile switch), where only the control
client (and its own per-client NetInfo dedup) is replaced. As a result, the
first netcheck after the swap produces a structurally-identical NetInfo
(same PreferredDERP, same NAT shape), magicsock suppresses it as unchanged,
and the new control session never learns our home DERP. Peers can't reach
the node over DERP until some unrelated NetInfo field happens to change.

Add Conn.ResetNetInfoLast to clear the dedup cache, and call it from
LocalBackend.setControlClientLocked whenever a control client is installed,
so the next netcheck re-reports the current NetInfo to the new client.

netInfoLast is only a dedup/optimization cache (all readers nil-guard, and
it is recomputed by every netcheck), so clearing it can only add a delivery,
never lose or misroute one; it is scoped to control-client lifecycle events,
not steady-state operation.

Updates #17887
Fixes #20024

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
2026-06-05 13:36:00 -04:00
..
auditlog all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
conffile all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
desktop ipn/desktop: use runtime.Pinner to force heap-allocation of msg 2026-04-07 12:55:11 -05:00
ipnauth all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipnext net/routecheck: introduce new package for checking peer reachability (#19639) 2026-06-01 10:33:08 -07:00
ipnlocal ipn/ipnlocal,wgengine/magicsock: re-report NetInfo to new control client (#20025) 2026-06-05 13:36:00 -04:00
ipnserver ipn/ipnserver: use peercreds for actor.Username on freebsd (for Taildrive) 2026-03-24 20:35:56 -07:00
ipnstate all: update a few more references to network/tailnet lock 2026-05-28 16:44:16 +01:00
lapitest types/ptr: deprecate ptr.To, use Go 1.26 new 2026-03-05 20:13:18 -08:00
localapi ipn,ipn/localapi: require local admin to serve Unix domain sockets 2026-06-03 09:45:02 -06:00
policy all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
store ipn/store: make WriteState(id, nil) delete key instead of adding nil entry (#19920) 2026-05-29 11:22:14 -07:00
backend_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
backend.go cmd/containerboot: track peers from IPN bus updates, stop using netmap.NetworkMap 2026-05-27 14:12:48 -07:00
conf_test.go ipn: reject advertised routes with non-address bits set (#18649) 2026-03-20 10:10:43 -07:00
conf.go ipn: fix the typo causing NoSNAT always set to true (#19110) 2026-03-24 16:41:58 -04:00
doc.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipn_clone.go tailcfg: reintroduce UserProfile.Groups 2026-03-09 11:08:45 +00:00
ipn_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipn_view.go tailcfg: reintroduce UserProfile.Groups 2026-03-09 11:08:45 +00:00
prefs_test.go ipn: improve --exit-node hostname error during startup 2026-05-28 16:43:45 +01:00
prefs.go ipn: improve --exit-node hostname error during startup 2026-05-28 16:43:45 +01: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