mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 08:01:31 +00:00
wgengine: update for wgcfg changes
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
@@ -237,15 +237,15 @@ func (e *userspaceEngine) Reconfig(cfg *wgcfg.Config, dnsDomains []string) error
|
||||
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)
|
||||
}
|
||||
|
||||
// TODO(apenwarr): only handling the first local address.
|
||||
// Currently we never use more than one anyway.
|
||||
var cidr wgcfg.CIDR
|
||||
if len(cfg.Interface.Addresses) > 0 {
|
||||
cidr = cfg.Interface.Addresses[0]
|
||||
if len(cfg.Addresses) > 0 {
|
||||
cidr = cfg.Addresses[0]
|
||||
// TODO(apenwarr): this shouldn't be hardcoded in the client
|
||||
cidr.Mask = 10 // route the whole cgnat range
|
||||
}
|
||||
@@ -253,7 +253,7 @@ func (e *userspaceEngine) Reconfig(cfg *wgcfg.Config, dnsDomains []string) error
|
||||
rs := RouteSettings{
|
||||
LocalAddr: cidr,
|
||||
Cfg: cfg,
|
||||
DNS: cfg.Interface.Dns,
|
||||
DNS: cfg.DNS,
|
||||
DNSDomains: dnsDomains,
|
||||
}
|
||||
e.logf("Reconfiguring router. la=%v dns=%v dom=%v\n",
|
||||
|
@@ -6,7 +6,6 @@ package wgengine
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/tailscale/wireguard-go/device"
|
||||
@@ -46,7 +45,7 @@ type StatusCallback func(*Status, error)
|
||||
// itself, like DNS stuff.
|
||||
type RouteSettings struct {
|
||||
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
|
||||
Cfg *wgcfg.Config
|
||||
}
|
||||
|
Reference in New Issue
Block a user