mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
hostinfo: add hostinfo.IsNATLabGuestVM
And don't make guests under vnet/natlab upload to logcatcher, as there won't be a valid cert anyway. Updates #13038 Change-Id: Ie1ce0139788036b8ecc1804549a9b5d326c5fef5 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Maisem Ali

parent
8594292aa4
commit
1016aa045f
@@ -27,6 +27,7 @@ import (
|
||||
"tailscale.com/util/dnsname"
|
||||
"tailscale.com/util/lineread"
|
||||
"tailscale.com/version"
|
||||
"tailscale.com/version/distro"
|
||||
)
|
||||
|
||||
var started = time.Now()
|
||||
@@ -462,3 +463,15 @@ func IsSELinuxEnforcing() bool {
|
||||
out, _ := exec.Command("getenforce").Output()
|
||||
return string(bytes.TrimSpace(out)) == "Enforcing"
|
||||
}
|
||||
|
||||
// IsNATLabGuestVM reports whether the current host is a NAT Lab guest VM.
|
||||
func IsNATLabGuestVM() bool {
|
||||
if runtime.GOOS == "linux" && distro.Get() == distro.Gokrazy {
|
||||
cmdLine, _ := os.ReadFile("/proc/cmdline")
|
||||
return bytes.Contains(cmdLine, []byte("tailscale-tta=1"))
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// NAT Lab VMs have a unique MAC address prefix.
|
||||
// See
|
||||
|
Reference in New Issue
Block a user