net/tstun: rename from net/tun.

We depend on wireguard-go/tun, identical leaf packages can be
confusing in code.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2021-03-26 22:07:19 -07:00 committed by Dave Anderson
parent 2b4bfeda1a
commit 018200aeba
6 changed files with 9 additions and 9 deletions

View File

@ -105,7 +105,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
tailscale.com/net/tlsdial from tailscale.com/control/controlclient+ tailscale.com/net/tlsdial from tailscale.com/control/controlclient+
tailscale.com/net/tsaddr from tailscale.com/ipn/ipnlocal+ tailscale.com/net/tsaddr from tailscale.com/ipn/ipnlocal+
💣 tailscale.com/net/tshttpproxy from tailscale.com/control/controlclient+ 💣 tailscale.com/net/tshttpproxy from tailscale.com/control/controlclient+
tailscale.com/net/tun from tailscale.com/cmd/tailscaled tailscale.com/net/tstun from tailscale.com/cmd/tailscaled
tailscale.com/paths from tailscale.com/cmd/tailscaled+ tailscale.com/paths from tailscale.com/cmd/tailscaled+
tailscale.com/portlist from tailscale.com/ipn/ipnlocal tailscale.com/portlist from tailscale.com/ipn/ipnlocal
tailscale.com/safesocket from tailscale.com/ipn/ipnserver tailscale.com/safesocket from tailscale.com/ipn/ipnserver

View File

@ -32,7 +32,7 @@
"tailscale.com/ipn/ipnserver" "tailscale.com/ipn/ipnserver"
"tailscale.com/logpolicy" "tailscale.com/logpolicy"
"tailscale.com/net/socks5" "tailscale.com/net/socks5"
"tailscale.com/net/tun" ntun "tailscale.com/net/tstun"
"tailscale.com/paths" "tailscale.com/paths"
"tailscale.com/types/flagtype" "tailscale.com/types/flagtype"
"tailscale.com/types/logger" "tailscale.com/types/logger"
@ -337,9 +337,9 @@ func tryEngine(logf logger.Logf, linkMon *monitor.Mon, name string) (e wgengine.
conf.TUN = tstun.NewFakeTUN() conf.TUN = tstun.NewFakeTUN()
conf.Router = router.NewFake(logf) conf.Router = router.NewFake(logf)
} else { } else {
dev, err := tun.New(logf, name) dev, err := ntun.New(logf, name)
if err != nil { if err != nil {
tun.Diagnose(logf, name) ntun.Diagnose(logf, name)
return nil, false, err return nil, false, err
} }
conf.TUN = dev conf.TUN = dev

View File

@ -30,7 +30,7 @@
"golang.zx2c4.com/wireguard/windows/tunnel/winipcfg" "golang.zx2c4.com/wireguard/windows/tunnel/winipcfg"
"tailscale.com/ipn/ipnserver" "tailscale.com/ipn/ipnserver"
"tailscale.com/logpolicy" "tailscale.com/logpolicy"
"tailscale.com/net/tun" "tailscale.com/net/tstun"
"tailscale.com/tempfork/wireguard-windows/firewall" "tailscale.com/tempfork/wireguard-windows/firewall"
"tailscale.com/types/logger" "tailscale.com/types/logger"
"tailscale.com/version" "tailscale.com/version"
@ -160,7 +160,7 @@ func startIPNServer(ctx context.Context, logid string) error {
var err error var err error
getEngine := func() (wgengine.Engine, error) { getEngine := func() (wgengine.Engine, error) {
dev, err := tun.New(logf, "Tailscale") dev, err := tstun.New(logf, "Tailscale")
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -4,7 +4,7 @@
// +build !windows // +build !windows
package tun package tstun
import ( import (
"time" "time"

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
package tun package tstun
import ( import (
"fmt" "fmt"

View File

@ -4,7 +4,7 @@
// Package tun creates a tuntap device, working around OS-specific // Package tun creates a tuntap device, working around OS-specific
// quirks if necessary. // quirks if necessary.
package tun package tstun
import ( import (
"bytes" "bytes"