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

Function createEngine

cmd/tailscaled/tailscaled.go:710–725  ·  view source on GitHub ↗

createEngine tries to the wgengine.Engine based on the order of tunnels specified in the command line flags. onlyNetstack is true if the user has explicitly requested that we use netstack for all networking.

(logf logger.Logf, sys *tsd.System)

Source from the content-addressed store, hash-verified

708// onlyNetstack is true if the user has explicitly requested that we use netstack
709// for all networking.
710func createEngine(logf logger.Logf, sys *tsd.System) (onlyNetstack bool, err error) {
711 if args.tunname == "" {
712 return false, errors.New("no --tun value specified")
713 }
714 var errs []error
715 for _, name := range strings.Split(args.tunname, ",") {
716 logf("wgengine.NewUserspaceEngine(tun %q) ...", name)
717 onlyNetstack, err = tryEngine(logf, sys, name)
718 if err == nil {
719 return onlyNetstack, nil
720 }
721 logf("wgengine.NewUserspaceEngine(tun %q) error: %v", name, err)
722 errs = append(errs, err)
723 }
724 return false, errors.Join(errs...)
725}
726
727// handleSubnetsInNetstack reports whether netstack should handle subnet routers
728// as opposed to the OS. We do this if the OS doesn't support subnet routers

Callers 1

getLocalBackendFunction · 0.85

Calls 3

tryEngineFunction · 0.85
SplitMethod · 0.80
NewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…