diff --git a/go.mod b/go.mod index 094c453b7..4e70bc63d 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( golang.zx2c4.com/wireguard v0.0.0-20210525143454-64cb82f2b3f5 golang.zx2c4.com/wireguard/windows v0.3.15-0.20210525143335-94c0476d63e3 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/peercred v0.0.0-20210318190834-4259e17bb763 inet.af/wf v0.0.0-20210516214145-a5343001b756 diff --git a/go.sum b/go.sum index 024fc0702..6abcb32f0 100644 --- a/go.sum +++ b/go.sum @@ -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-20210523191804-d57edf19c517 h1:gieHAlViNfjNt0m6gKr4aazCMXQobPMOqeyQ1ZN5ekw= 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/go.mod h1:GVx+5OZtbG4TVOW5ilmyRZAZXr1cNwfqUEkTOtWK0PM= inet.af/peercred v0.0.0-20210318190834-4259e17bb763 h1:gPSJmmVzmdy4kHhlCMx912GdiUz3k/RzJGg0ADqy1dg= diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index ba75a2fa7..c4be19dd0 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -929,8 +929,8 @@ func (b *LocalBackend) updateFilter(netMap *netmap.NetworkMap, prefs *ipn.Prefs) } } } - localNets := localNetsB.IPSet() - logNets := logNetsB.IPSet() + localNets, _ := localNetsB.IPSet() + logNets, _ := logNetsB.IPSet() changed := deephash.UpdateHash(&b.filterHash, haveNetmap, addrs, packetFilter, localNets.Ranges(), logNets.Ranges(), shieldsUp) if !changed { @@ -987,7 +987,8 @@ func interfaceRoutes() (ips *netaddr.IPSet, hostIPs []netaddr.IP, err error) { 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, @@ -1018,7 +1019,7 @@ func shrinkDefaultRoute(route netaddr.IPPrefix) (*netaddr.IPSet, error) { for _, pfx := range removeFromDefaultRoute { b.RemovePrefix(pfx) } - return b.IPSet(), nil + return b.IPSet() } // dnsCIDRsEqual determines whether two CIDR lists are equal diff --git a/net/tstun/wrap_test.go b/net/tstun/wrap_test.go index 9b9c49cf3..1875e897b 100644 --- a/net/tstun/wrap_test.go +++ b/net/tstun/wrap_test.go @@ -146,7 +146,8 @@ func setfilter(logf logger.Logf, tun *Wrapper) { } var sb netaddr.IPSetBuilder 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) { diff --git a/wgengine/filter/filter.go b/wgengine/filter/filter.go index 789100edb..766d4c8a8 100644 --- a/wgengine/filter/filter.go +++ b/wgengine/filter/filter.go @@ -130,7 +130,8 @@ func NewAllowAllForTest(logf logger.Logf) *Filter { var sb netaddr.IPSetBuilder sb.AddPrefix(any4) 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. diff --git a/wgengine/filter/filter_test.go b/wgengine/filter/filter_test.go index 538a763d3..aef95334d 100644 --- a/wgengine/filter/filter_test.go +++ b/wgengine/filter/filter_test.go @@ -54,7 +54,10 @@ func newFilter(logf logger.Logf) *Filter { var logB netaddr.IPSetBuilder 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) { @@ -424,7 +427,7 @@ func TestLoggingPrivacy(t *testing.T) { logB.AddPrefix(netaddr.MustParseIPPrefix("100.64.0.0/10")) logB.AddPrefix(tsaddr.TailscaleULARange()) f := newFilter(logf) - f.logIPs = logB.IPSet() + f.logIPs, _ = logB.IPSet() var ( ts4 = netaddr.IPPortFrom(tsaddr.CGNATRange().IP().Next(), 1234)