wgengine: replace Engine.SetNetworkMap with SetSelfNode

The engine only used the netmap to look up self addresses and the
self node's primary routes, so pass it the self node directly
rather than the whole netmap.

Updates #12542

Change-Id: I13c0028eed65d2177baf4cf6c449f5e441845a18
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2026-06-24 15:03:55 -07:00
committed by Brad Fitzpatrick
parent 1b2062f3c1
commit 87cb2a8d1e
6 changed files with 46 additions and 70 deletions
+3 -6
View File
@@ -175,12 +175,9 @@ type Engine interface {
// You don't have to call this.
Done() <-chan struct{}
// SetNetworkMap informs the engine of the latest network map
// from the server. The network map's DERPMap field should be
// ignored as as it might be disabled; get it from SetDERPMap
// instead.
// The network map should only be read from.
SetNetworkMap(*netmap.NetworkMap)
// SetSelfNode informs the engine of the current self node.
// The zero (invalid) NodeView indicates no self node.
SetSelfNode(tailcfg.NodeView)
// UpdateStatus populates the network state using the provided
// status builder.