MCPcopy Index your code
hub / github.com/tailscale/tailscale / handleSubnetsInNetstack

Function handleSubnetsInNetstack

cmd/tailscaled/tailscaled.go:731–745  ·  view source on GitHub ↗

handleSubnetsInNetstack reports whether netstack should handle subnet routers as opposed to the OS. We do this if the OS doesn't support subnet routers (e.g. Windows) or if the user has explicitly requested it (e.g. --tun=userspace-networking).

()

Source from the content-addressed store, hash-verified

729// (e.g. Windows) or if the user has explicitly requested it (e.g.
730// --tun=userspace-networking).
731func handleSubnetsInNetstack() bool {
732 if v, ok := envknob.LookupBool("TS_DEBUG_NETSTACK_SUBNETS"); ok {
733 return v
734 }
735 if distro.Get() == distro.Synology {
736 return true
737 }
738 switch runtime.GOOS {
739 case "windows", "darwin", "freebsd", "openbsd", "solaris", "illumos":
740 // Enable on Windows and tailscaled-on-macOS (this doesn't
741 // affect the GUI clients), and on FreeBSD.
742 return true
743 }
744 return false
745}
746
747var tstunNew = tstun.New
748

Callers 2

tryEngineFunction · 0.85
newNetstackFunction · 0.85

Calls 2

LookupBoolFunction · 0.92
GetFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…