mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-22 19:09:58 +00:00
all: use network less when running in v86 emulator
Updates #5794 Change-Id: I1d8b005a1696835c9062545f87b7bab643cfc44d Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
29c2bb1db6
commit
65c7a37bc6
@@ -21,6 +21,7 @@ import (
|
||||
"go4.org/mem"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/lazy"
|
||||
"tailscale.com/types/opt"
|
||||
"tailscale.com/types/ptr"
|
||||
"tailscale.com/util/cloudenv"
|
||||
@@ -497,5 +498,14 @@ func IsNATLabGuestVM() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// NAT Lab VMs have a unique MAC address prefix.
|
||||
// See
|
||||
const copyV86DeviceModel = "copy-v86"
|
||||
|
||||
var isV86Cache lazy.SyncValue[bool]
|
||||
|
||||
// IsInVM86 reports whether we're running in the copy/v86 wasm emulator,
|
||||
// https://github.com/copy/v86/.
|
||||
func IsInVM86() bool {
|
||||
return isV86Cache.Get(func() bool {
|
||||
return New().DeviceModel == copyV86DeviceModel
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user