mirror of
https://github.com/tailscale/tailscale.git
synced 2026-03-07 06:22:26 +01:00
ipn/ipnlocal: skip writing netmaps to disk when disabled (#18883)
We use the TS_USE_CACHED_NETMAP knob to condition loading a cached netmap, but were hitherto writing the map out to disk even when it was disabled. Let's not do that; the two should travel together. Updates #12639 Change-Id: Iee5aa828e2c59937d5b95093ea1ac26c9536721e Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:
parent
ea1f1616b9
commit
26951a1cbb
@ -6241,8 +6241,10 @@ func (b *LocalBackend) setNetMapLocked(nm *netmap.NetworkMap) {
|
||||
var login string
|
||||
if nm != nil {
|
||||
login = cmp.Or(profileFromView(nm.UserProfiles[nm.User()]).LoginName, "<missing-profile>")
|
||||
if err := b.writeNetmapToDiskLocked(nm); err != nil {
|
||||
b.logf("write netmap to cache: %v", err)
|
||||
if envknob.Bool("TS_USE_CACHED_NETMAP") {
|
||||
if err := b.writeNetmapToDiskLocked(nm); err != nil {
|
||||
b.logf("write netmap to cache: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
b.currentNode().SetNetMap(nm)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user