|
|
@ -16,7 +16,6 @@ import (
|
|
|
|
"syscall"
|
|
|
|
"syscall"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/tailscale/wireguard-go/device"
|
|
|
|
|
|
|
|
"github.com/tailscale/wireguard-go/tun"
|
|
|
|
"github.com/tailscale/wireguard-go/tun"
|
|
|
|
"golang.org/x/sys/windows"
|
|
|
|
"golang.org/x/sys/windows"
|
|
|
|
"golang.zx2c4.com/wireguard/windows/tunnel/winipcfg"
|
|
|
|
"golang.zx2c4.com/wireguard/windows/tunnel/winipcfg"
|
|
|
@ -30,7 +29,6 @@ type winRouter struct {
|
|
|
|
logf func(fmt string, args ...interface{})
|
|
|
|
logf func(fmt string, args ...interface{})
|
|
|
|
tunname string
|
|
|
|
tunname string
|
|
|
|
nativeTun *tun.NativeTun
|
|
|
|
nativeTun *tun.NativeTun
|
|
|
|
wgdev *device.Device
|
|
|
|
|
|
|
|
routeChangeCallback *winipcfg.RouteChangeCallback
|
|
|
|
routeChangeCallback *winipcfg.RouteChangeCallback
|
|
|
|
dns *dns.Manager
|
|
|
|
dns *dns.Manager
|
|
|
|
firewall *firewallTweaker
|
|
|
|
firewall *firewallTweaker
|
|
|
@ -45,7 +43,7 @@ type winRouter struct {
|
|
|
|
firewallSubproc *exec.Cmd
|
|
|
|
firewallSubproc *exec.Cmd
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func newUserspaceRouter(logf logger.Logf, wgdev *device.Device, tundev tun.Device) (Router, error) {
|
|
|
|
func newUserspaceRouter(logf logger.Logf, tundev tun.Device) (Router, error) {
|
|
|
|
tunname, err := tundev.Name()
|
|
|
|
tunname, err := tundev.Name()
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
@ -65,7 +63,6 @@ func newUserspaceRouter(logf logger.Logf, wgdev *device.Device, tundev tun.Devic
|
|
|
|
|
|
|
|
|
|
|
|
return &winRouter{
|
|
|
|
return &winRouter{
|
|
|
|
logf: logf,
|
|
|
|
logf: logf,
|
|
|
|
wgdev: wgdev,
|
|
|
|
|
|
|
|
tunname: tunname,
|
|
|
|
tunname: tunname,
|
|
|
|
nativeTun: nativeTun,
|
|
|
|
nativeTun: nativeTun,
|
|
|
|
dns: dns.NewManager(mconfig),
|
|
|
|
dns: dns.NewManager(mconfig),
|
|
|
|