mirror of
https://github.com/tailscale/tailscale.git
synced 2026-06-11 21:02:39 +08:00
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> |
||
|---|---|---|
| .. | ||
| auditlog | ||
| conffile | ||
| desktop | ||
| ipnauth | ||
| ipnext | ||
| ipnlocal | ||
| ipnserver | ||
| ipnstate | ||
| lapitest | ||
| localapi | ||
| policy | ||
| store | ||
| backend_test.go | ||
| backend.go | ||
| conf_test.go | ||
| conf.go | ||
| doc.go | ||
| ipn_clone.go | ||
| ipn_test.go | ||
| ipn_view.go | ||
| prefs_test.go | ||
| prefs.go | ||
| serve_expand_test.go | ||
| serve_test.go | ||
| serve.go | ||
| store_test.go | ||
| store.go | ||