diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index e025260ad..8cd6695c3 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -333,7 +333,7 @@ func tryEngine(logf logger.Logf, linkMon *monitor.Mon, name string) (e wgengine. } isUserspace = name == "userspace-networking" if isUserspace { - conf.TUN = tstun.NewFakeTUN() + conf.TUN = tstun.NewFake() conf.Router = router.NewFake(logf) } else { dev, err := tstun.New(logf, name) diff --git a/net/tstun/fake.go b/net/tstun/fake.go index 50880131a..f9c3a9d6f 100644 --- a/net/tstun/fake.go +++ b/net/tstun/fake.go @@ -16,10 +16,8 @@ type fakeTUN struct { closechan chan struct{} } -// NewFakeTUN returns a fake TUN device that does not depend on the -// operating system or any special permissions. -// It primarily exists for testing. -func NewFakeTUN() tun.Device { +// NewFake returns a tun.Device that does nothing. +func NewFake() tun.Device { return &fakeTUN{ evchan: make(chan tun.Event), closechan: make(chan struct{}), diff --git a/net/tstun/wrap_test.go b/net/tstun/wrap_test.go index 2ba798222..2fe82cf06 100644 --- a/net/tstun/wrap_test.go +++ b/net/tstun/wrap_test.go @@ -132,7 +132,7 @@ func newChannelTUN(logf logger.Logf, secure bool) (*tuntest.ChannelTUN, *TUN) { } func newFakeTUN(logf logger.Logf, secure bool) (*fakeTUN, *TUN) { - ftun := NewFakeTUN() + ftun := NewFake() tun := WrapTUN(logf, ftun) if secure { setfilter(logf, tun) diff --git a/wgengine/userspace.go b/wgengine/userspace.go index d7ee6314d..f72e8640f 100644 --- a/wgengine/userspace.go +++ b/wgengine/userspace.go @@ -156,7 +156,7 @@ type Config struct { func NewFakeUserspaceEngine(logf logger.Logf, listenPort uint16) (Engine, error) { logf("Starting userspace wireguard engine (with fake TUN device)") return NewUserspaceEngine(logf, Config{ - TUN: tstun.NewFakeTUN(), + TUN: tstun.NewFake(), Router: router.NewFake(logf), ListenPort: listenPort, Fake: true,