wgengine/router: use inet.af/netaddr, not wgcfg.CIDR.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-05-08 05:17:30 +00:00
committed by Dave Anderson
parent b8f01eed34
commit b01db109f5
8 changed files with 70 additions and 45 deletions

View File

@@ -310,12 +310,12 @@ func configureInterface(rs Settings, tun *tun.NativeTun) error {
continue
}
if route.IP.Is4() {
if route.Mask == 0 {
if route.Bits == 0 {
foundDefault4 = true
}
r.NextHop = *firstGateway4
} else if route.IP.Is6() {
if route.Mask == 0 {
if route.Bits == 0 {
foundDefault6 = true
}
r.NextHop = *firstGateway6
@@ -360,7 +360,7 @@ func configureInterface(rs Settings, tun *tun.NativeTun) error {
var dnsIPs []net.IP
for _, ip := range rs.DNS {
dnsIPs = append(dnsIPs, ip.IP())
dnsIPs = append(dnsIPs, ip.IPAddr().IP)
}
err = iface.SetDNS(dnsIPs)
if err != nil && errAcc == nil {