net/netaddr: start migrating to net/netip via new netaddr adapter package

Updates #5162

Change-Id: Id7bdec303b25471f69d542f8ce43805328d56c12
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2022-07-24 20:08:42 -07:00
committed by Brad Fitzpatrick
parent 7b1a91dfd3
commit 7eaf5e509f
191 changed files with 1009 additions and 888 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"strings"
"time"
"inet.af/netaddr"
"tailscale.com/net/netaddr"
"tailscale.com/types/dnstype"
"tailscale.com/types/key"
"tailscale.com/types/opt"
+6 -6
View File
@@ -7,9 +7,9 @@
package tailcfg
import (
"net/netip"
"time"
"inet.af/netaddr"
"tailscale.com/types/dnstype"
"tailscale.com/types/key"
"tailscale.com/types/opt"
@@ -76,14 +76,14 @@ var _NodeCloneNeedsRegeneration = Node(struct {
KeyExpiry time.Time
Machine key.MachinePublic
DiscoKey key.DiscoPublic
Addresses []netaddr.IPPrefix
AllowedIPs []netaddr.IPPrefix
Addresses []netip.Prefix
AllowedIPs []netip.Prefix
Endpoints []string
DERP string
Hostinfo HostinfoView
Created time.Time
Tags []string
PrimaryRoutes []netaddr.IPPrefix
PrimaryRoutes []netip.Prefix
LastSeen *time.Time
Online *bool
KeepAlive bool
@@ -124,7 +124,7 @@ var _HostinfoCloneNeedsRegeneration = Hostinfo(struct {
ShieldsUp bool
ShareeNode bool
GoArch string
RoutableIPs []netaddr.IPPrefix
RoutableIPs []netip.Prefix
RequestTags []string
Services []Service
NetInfo *NetInfo
@@ -224,7 +224,7 @@ var _DNSConfigCloneNeedsRegeneration = DNSConfig(struct {
FallbackResolvers []*dnstype.Resolver
Domains []string
Proxied bool
Nameservers []netaddr.IP
Nameservers []netip.Addr
PerDomain bool
CertDomains []string
ExtraRecords []DNSRecord
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"testing"
"time"
"inet.af/netaddr"
"tailscale.com/net/netaddr"
"tailscale.com/tstest"
"tailscale.com/types/key"
"tailscale.com/version"
+7 -7
View File
@@ -9,9 +9,9 @@ package tailcfg
import (
"encoding/json"
"errors"
"net/netip"
"time"
"inet.af/netaddr"
"tailscale.com/types/dnstype"
"tailscale.com/types/key"
"tailscale.com/types/opt"
@@ -183,14 +183,14 @@ var _NodeViewNeedsRegeneration = Node(struct {
KeyExpiry time.Time
Machine key.MachinePublic
DiscoKey key.DiscoPublic
Addresses []netaddr.IPPrefix
AllowedIPs []netaddr.IPPrefix
Addresses []netip.Prefix
AllowedIPs []netip.Prefix
Endpoints []string
DERP string
Hostinfo HostinfoView
Created time.Time
Tags []string
PrimaryRoutes []netaddr.IPPrefix
PrimaryRoutes []netip.Prefix
LastSeen *time.Time
Online *bool
KeepAlive bool
@@ -282,7 +282,7 @@ var _HostinfoViewNeedsRegeneration = Hostinfo(struct {
ShieldsUp bool
ShareeNode bool
GoArch string
RoutableIPs []netaddr.IPPrefix
RoutableIPs []netip.Prefix
RequestTags []string
Services []Service
NetInfo *NetInfo
@@ -488,7 +488,7 @@ func (v DNSConfigView) FallbackResolvers() views.SliceView[*dnstype.Resolver, dn
}
func (v DNSConfigView) Domains() views.Slice[string] { return views.SliceOf(v.ж.Domains) }
func (v DNSConfigView) Proxied() bool { return v.ж.Proxied }
func (v DNSConfigView) Nameservers() views.Slice[netaddr.IP] { return views.SliceOf(v.ж.Nameservers) }
func (v DNSConfigView) Nameservers() views.Slice[netip.Addr] { return views.SliceOf(v.ж.Nameservers) }
func (v DNSConfigView) PerDomain() bool { return v.ж.PerDomain }
func (v DNSConfigView) CertDomains() views.Slice[string] { return views.SliceOf(v.ж.CertDomains) }
func (v DNSConfigView) ExtraRecords() views.Slice[DNSRecord] { return views.SliceOf(v.ж.ExtraRecords) }
@@ -503,7 +503,7 @@ var _DNSConfigViewNeedsRegeneration = DNSConfig(struct {
FallbackResolvers []*dnstype.Resolver
Domains []string
Proxied bool
Nameservers []netaddr.IP
Nameservers []netip.Addr
PerDomain bool
CertDomains []string
ExtraRecords []DNSRecord