wgengine: update for wgcfg changes

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
pull/78/head
David Crawshaw 5 years ago
parent c4f6f622f0
commit d0f697ee07

@ -16,7 +16,7 @@ require (
github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3 github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3
github.com/tailscale/hujson v0.0.0-20190930033718-5098e564d9b3 github.com/tailscale/hujson v0.0.0-20190930033718-5098e564d9b3
github.com/tailscale/winipcfg-go v0.0.0-20200213045944-185b07f8233f github.com/tailscale/winipcfg-go v0.0.0-20200213045944-185b07f8233f
github.com/tailscale/wireguard-go v0.0.0-20200213180345-a7c4b7719b1d github.com/tailscale/wireguard-go v0.0.0-20200219153225-c9c88282e81d
golang.org/x/crypto v0.0.0-20200210222208-86ce3cb69678 golang.org/x/crypto v0.0.0-20200210222208-86ce3cb69678
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sys v0.0.0-20200217220822-9197077df867 golang.org/x/sys v0.0.0-20200217220822-9197077df867

@ -237,15 +237,15 @@ func (e *userspaceEngine) Reconfig(cfg *wgcfg.Config, dnsDomains []string) error
return err return err
} }
if err := e.magicConn.SetPrivateKey(cfg.Interface.PrivateKey); err != nil { if err := e.magicConn.SetPrivateKey(cfg.PrivateKey); err != nil {
e.logf("magicsock: %v\n", err) e.logf("magicsock: %v\n", err)
} }
// TODO(apenwarr): only handling the first local address. // TODO(apenwarr): only handling the first local address.
// Currently we never use more than one anyway. // Currently we never use more than one anyway.
var cidr wgcfg.CIDR var cidr wgcfg.CIDR
if len(cfg.Interface.Addresses) > 0 { if len(cfg.Addresses) > 0 {
cidr = cfg.Interface.Addresses[0] cidr = cfg.Addresses[0]
// TODO(apenwarr): this shouldn't be hardcoded in the client // TODO(apenwarr): this shouldn't be hardcoded in the client
cidr.Mask = 10 // route the whole cgnat range cidr.Mask = 10 // route the whole cgnat range
} }
@ -253,7 +253,7 @@ func (e *userspaceEngine) Reconfig(cfg *wgcfg.Config, dnsDomains []string) error
rs := RouteSettings{ rs := RouteSettings{
LocalAddr: cidr, LocalAddr: cidr,
Cfg: cfg, Cfg: cfg,
DNS: cfg.Interface.Dns, DNS: cfg.DNS,
DNSDomains: dnsDomains, DNSDomains: dnsDomains,
} }
e.logf("Reconfiguring router. la=%v dns=%v dom=%v\n", e.logf("Reconfiguring router. la=%v dns=%v dom=%v\n",

@ -6,7 +6,6 @@ package wgengine
import ( import (
"fmt" "fmt"
"net"
"time" "time"
"github.com/tailscale/wireguard-go/device" "github.com/tailscale/wireguard-go/device"
@ -46,7 +45,7 @@ type StatusCallback func(*Status, error)
// itself, like DNS stuff. // itself, like DNS stuff.
type RouteSettings struct { type RouteSettings struct {
LocalAddr wgcfg.CIDR // TODO: why is this here? how does it differ from wgcfg.Config's info? LocalAddr wgcfg.CIDR // TODO: why is this here? how does it differ from wgcfg.Config's info?
DNS []net.IP DNS []wgcfg.IP
DNSDomains []string DNSDomains []string
Cfg *wgcfg.Config Cfg *wgcfg.Config
} }

Loading…
Cancel
Save