mirror of
https://github.com/tailscale/tailscale.git
synced 2026-09-15 07:20:36 -04:00
Nothing reads ipn.Notify.NetMap anymore. The previous commit removed its runtime (non-initial) emission, and every first-party client is also off the initial one: the Win32 and WinUI GUIs and the Apple bridge subscribe with InitialStatus or InitialState plus peer deltas, Android no longer uses it, and the remaining in-tree subscribers that set NotifyInitialNetMap (sniproxy and the kube helpers) only did so to get the initial Notify.SelfChange and discarded the netmap that tailscaled built, encoded, and shipped for them. Delete the Notify.NetMap field and the NotifyInitialNetMap bit. The bit value stays reserved under the name ObsoleteNotifyInitialNetMap and ValidateNotifyWatchOpt rejects subscriptions that set it, like the NotifyRateLimit bit removed in the previous commit. NotifyNoNetMap remains accepted as a no-op because shipping GUIs still set it. The blessed way to seed a watcher's view is NotifyInitialStatus, but it unconditionally built O(peers) status entries, which is exactly the waste this series is deleting for watchers that only care about the self node. Size the initial status to the subscription instead: Status.Peer is only populated when the watcher also set NotifyPeerChanges or NotifyPeerPatches, since only peer-delta subscribers need a peer baseline to apply deltas to. That matches its existing first-party users (containerboot and the WinUI GUI both pair InitialStatus with peer bits). Migrate sniproxy and the kube helpers to NotifyInitialStatus: they seed from InitialStatus.Self and react to the (ungated) runtime Notify.SelfChange messages after that, so their initial message now carries one PeerStatus instead of a full netmap. Also drop doc comment references to LocalClient.NetMap, a method that does not exist; on-demand fetches go through other LocalAPI methods such as LocalClient.Status. Updates #12542 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> Change-Id: I242992a744c0ffd0be6f27e8c735aa69d5b23b5e