go.mod: update netaddr

Involves minor IPSetBuilder.Set API change.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-06-02 09:04:37 -07:00
parent 9794be375d
commit a321c24667
6 changed files with 17 additions and 9 deletions

2
go.mod
View File

@ -39,7 +39,7 @@ require (
golang.zx2c4.com/wireguard v0.0.0-20210525143454-64cb82f2b3f5 golang.zx2c4.com/wireguard v0.0.0-20210525143454-64cb82f2b3f5
golang.zx2c4.com/wireguard/windows v0.3.15-0.20210525143335-94c0476d63e3 golang.zx2c4.com/wireguard/windows v0.3.15-0.20210525143335-94c0476d63e3
honnef.co/go/tools v0.1.4 honnef.co/go/tools v0.1.4
inet.af/netaddr v0.0.0-20210523191804-d57edf19c517 inet.af/netaddr v0.0.0-20210602152128-50f8686885e3
inet.af/netstack v0.0.0-20210317161235-a1bf4e56ef22 inet.af/netstack v0.0.0-20210317161235-a1bf4e56ef22
inet.af/peercred v0.0.0-20210318190834-4259e17bb763 inet.af/peercred v0.0.0-20210318190834-4259e17bb763
inet.af/wf v0.0.0-20210516214145-a5343001b756 inet.af/wf v0.0.0-20210516214145-a5343001b756

2
go.sum
View File

@ -963,6 +963,8 @@ honnef.co/go/tools v0.1.4/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
inet.af/netaddr v0.0.0-20210515010201-ad03edc7c841/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls= inet.af/netaddr v0.0.0-20210515010201-ad03edc7c841/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls=
inet.af/netaddr v0.0.0-20210523191804-d57edf19c517 h1:gieHAlViNfjNt0m6gKr4aazCMXQobPMOqeyQ1ZN5ekw= inet.af/netaddr v0.0.0-20210523191804-d57edf19c517 h1:gieHAlViNfjNt0m6gKr4aazCMXQobPMOqeyQ1ZN5ekw=
inet.af/netaddr v0.0.0-20210523191804-d57edf19c517/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls= inet.af/netaddr v0.0.0-20210523191804-d57edf19c517/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls=
inet.af/netaddr v0.0.0-20210602152128-50f8686885e3 h1:RlarOdsmOUCCvy7Xm1JchJIGuQsuKwD/Lo1bjYmfuQI=
inet.af/netaddr v0.0.0-20210602152128-50f8686885e3/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls=
inet.af/netstack v0.0.0-20210317161235-a1bf4e56ef22 h1:DNtszwGa6w76qlIr+PbPEnlBJdiRV8SaxeigOy0q1gg= inet.af/netstack v0.0.0-20210317161235-a1bf4e56ef22 h1:DNtszwGa6w76qlIr+PbPEnlBJdiRV8SaxeigOy0q1gg=
inet.af/netstack v0.0.0-20210317161235-a1bf4e56ef22/go.mod h1:GVx+5OZtbG4TVOW5ilmyRZAZXr1cNwfqUEkTOtWK0PM= inet.af/netstack v0.0.0-20210317161235-a1bf4e56ef22/go.mod h1:GVx+5OZtbG4TVOW5ilmyRZAZXr1cNwfqUEkTOtWK0PM=
inet.af/peercred v0.0.0-20210318190834-4259e17bb763 h1:gPSJmmVzmdy4kHhlCMx912GdiUz3k/RzJGg0ADqy1dg= inet.af/peercred v0.0.0-20210318190834-4259e17bb763 h1:gPSJmmVzmdy4kHhlCMx912GdiUz3k/RzJGg0ADqy1dg=

View File

@ -929,8 +929,8 @@ func (b *LocalBackend) updateFilter(netMap *netmap.NetworkMap, prefs *ipn.Prefs)
} }
} }
} }
localNets := localNetsB.IPSet() localNets, _ := localNetsB.IPSet()
logNets := logNetsB.IPSet() logNets, _ := logNetsB.IPSet()
changed := deephash.UpdateHash(&b.filterHash, haveNetmap, addrs, packetFilter, localNets.Ranges(), logNets.Ranges(), shieldsUp) changed := deephash.UpdateHash(&b.filterHash, haveNetmap, addrs, packetFilter, localNets.Ranges(), logNets.Ranges(), shieldsUp)
if !changed { if !changed {
@ -987,7 +987,8 @@ func interfaceRoutes() (ips *netaddr.IPSet, hostIPs []netaddr.IP, err error) {
return nil, nil, err return nil, nil, err
} }
return b.IPSet(), hostIPs, nil ipSet, _ := b.IPSet()
return ipSet, hostIPs, nil
} }
// shrinkDefaultRoute returns an IPSet representing the IPs in route, // shrinkDefaultRoute returns an IPSet representing the IPs in route,
@ -1018,7 +1019,7 @@ func shrinkDefaultRoute(route netaddr.IPPrefix) (*netaddr.IPSet, error) {
for _, pfx := range removeFromDefaultRoute { for _, pfx := range removeFromDefaultRoute {
b.RemovePrefix(pfx) b.RemovePrefix(pfx)
} }
return b.IPSet(), nil return b.IPSet()
} }
// dnsCIDRsEqual determines whether two CIDR lists are equal // dnsCIDRsEqual determines whether two CIDR lists are equal

View File

@ -146,7 +146,8 @@ func setfilter(logf logger.Logf, tun *Wrapper) {
} }
var sb netaddr.IPSetBuilder var sb netaddr.IPSetBuilder
sb.AddPrefix(netaddr.MustParseIPPrefix("1.2.0.0/16")) sb.AddPrefix(netaddr.MustParseIPPrefix("1.2.0.0/16"))
tun.SetFilter(filter.New(matches, sb.IPSet(), sb.IPSet(), nil, logf)) ipSet, _ := sb.IPSet()
tun.SetFilter(filter.New(matches, ipSet, ipSet, nil, logf))
} }
func newChannelTUN(logf logger.Logf, secure bool) (*tuntest.ChannelTUN, *Wrapper) { func newChannelTUN(logf logger.Logf, secure bool) (*tuntest.ChannelTUN, *Wrapper) {

View File

@ -130,7 +130,8 @@ func NewAllowAllForTest(logf logger.Logf) *Filter {
var sb netaddr.IPSetBuilder var sb netaddr.IPSetBuilder
sb.AddPrefix(any4) sb.AddPrefix(any4)
sb.AddPrefix(any6) sb.AddPrefix(any6)
return New(ms, sb.IPSet(), sb.IPSet(), nil, logf) ipSet, _ := sb.IPSet()
return New(ms, ipSet, ipSet, nil, logf)
} }
// NewAllowNone returns a packet filter that rejects everything. // NewAllowNone returns a packet filter that rejects everything.

View File

@ -54,7 +54,10 @@ func newFilter(logf logger.Logf) *Filter {
var logB netaddr.IPSetBuilder var logB netaddr.IPSetBuilder
logB.Complement() logB.Complement()
return New(matches, localNets.IPSet(), logB.IPSet(), nil, logf) localNetsSet, _ := localNets.IPSet()
logBSet, _ := logB.IPSet()
return New(matches, localNetsSet, logBSet, nil, logf)
} }
func TestFilter(t *testing.T) { func TestFilter(t *testing.T) {
@ -424,7 +427,7 @@ func TestLoggingPrivacy(t *testing.T) {
logB.AddPrefix(netaddr.MustParseIPPrefix("100.64.0.0/10")) logB.AddPrefix(netaddr.MustParseIPPrefix("100.64.0.0/10"))
logB.AddPrefix(tsaddr.TailscaleULARange()) logB.AddPrefix(tsaddr.TailscaleULARange())
f := newFilter(logf) f := newFilter(logf)
f.logIPs = logB.IPSet() f.logIPs, _ = logB.IPSet()
var ( var (
ts4 = netaddr.IPPortFrom(tsaddr.CGNATRange().IP().Next(), 1234) ts4 = netaddr.IPPortFrom(tsaddr.CGNATRange().IP().Next(), 1234)