net/tstun: rename NewFakeTUN to NewFake.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2021-03-26 22:46:37 -07:00
parent 588b70f468
commit 82ab7972f4
4 changed files with 5 additions and 7 deletions

View File

@@ -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{}),

View File

@@ -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)