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).
()
| 729 | // (e.g. Windows) or if the user has explicitly requested it (e.g. |
| 730 | // --tun=userspace-networking). |
| 731 | func 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 | |
| 747 | var tstunNew = tstun.New |
| 748 |
no test coverage detected
searching dependent graphs…