|
|
@ -27,7 +27,6 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
type winRouter struct {
|
|
|
|
type winRouter struct {
|
|
|
|
logf func(fmt string, args ...interface{})
|
|
|
|
logf func(fmt string, args ...interface{})
|
|
|
|
tunname string
|
|
|
|
|
|
|
|
nativeTun *tun.NativeTun
|
|
|
|
nativeTun *tun.NativeTun
|
|
|
|
routeChangeCallback *winipcfg.RouteChangeCallback
|
|
|
|
routeChangeCallback *winipcfg.RouteChangeCallback
|
|
|
|
dns *dns.Manager
|
|
|
|
dns *dns.Manager
|
|
|
@ -44,11 +43,6 @@ type winRouter struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func newUserspaceRouter(logf logger.Logf, tundev tun.Device) (Router, error) {
|
|
|
|
func newUserspaceRouter(logf logger.Logf, tundev tun.Device) (Router, error) {
|
|
|
|
tunname, err := tundev.Name()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nativeTun := tundev.(*tun.NativeTun)
|
|
|
|
nativeTun := tundev.(*tun.NativeTun)
|
|
|
|
luid := winipcfg.LUID(nativeTun.LUID())
|
|
|
|
luid := winipcfg.LUID(nativeTun.LUID())
|
|
|
|
guid, err := luid.GUID()
|
|
|
|
guid, err := luid.GUID()
|
|
|
@ -63,7 +57,6 @@ func newUserspaceRouter(logf logger.Logf, tundev tun.Device) (Router, error) {
|
|
|
|
|
|
|
|
|
|
|
|
return &winRouter{
|
|
|
|
return &winRouter{
|
|
|
|
logf: logf,
|
|
|
|
logf: logf,
|
|
|
|
tunname: tunname,
|
|
|
|
|
|
|
|
nativeTun: nativeTun,
|
|
|
|
nativeTun: nativeTun,
|
|
|
|
dns: dns.NewManager(mconfig),
|
|
|
|
dns: dns.NewManager(mconfig),
|
|
|
|
firewall: &firewallTweaker{
|
|
|
|
firewall: &firewallTweaker{
|
|
|
|