From e085aec8ef348a79f0843efb89b85ebb11368b76 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 16 Mar 2020 20:27:00 -0700 Subject: [PATCH] all: update to wireguard-go API changes Signed-off-by: Brad Fitzpatrick --- cmd/relaynode/relaynode.go | 2 +- cmd/tailscale/tailscale.go | 2 +- control/controlclient/auto_test.go | 6 +++--- go.mod | 3 +-- go.sum | 4 ++++ ipn/prefs.go | 2 +- ipn/prefs_test.go | 2 +- tailcfg/tailcfg_test.go | 2 +- wgengine/magicsock/magicsock_test.go | 2 +- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cmd/relaynode/relaynode.go b/cmd/relaynode/relaynode.go index f9d76b465..26ce77b13 100644 --- a/cmd/relaynode/relaynode.go +++ b/cmd/relaynode/relaynode.go @@ -138,7 +138,7 @@ func main() { if err != nil { log.Fatalf("--routes: not an IP range: %s", routeStr) } - hi.RoutableIPs = append(hi.RoutableIPs, *cidr) + hi.RoutableIPs = append(hi.RoutableIPs, cidr) } } diff --git a/cmd/tailscale/tailscale.go b/cmd/tailscale/tailscale.go index 96751d5d3..aa288c843 100644 --- a/cmd/tailscale/tailscale.go +++ b/cmd/tailscale/tailscale.go @@ -132,7 +132,7 @@ func runUp(ctx context.Context, args []string) error { if err != nil { log.Fatalf("%q is not a valid CIDR prefix: %v", s, err) } - adv = append(adv, *cidr) + adv = append(adv, cidr) } } diff --git a/control/controlclient/auto_test.go b/control/controlclient/auto_test.go index d4a090a37..1f08045cf 100644 --- a/control/controlclient/auto_test.go +++ b/control/controlclient/auto_test.go @@ -250,7 +250,7 @@ func TestControl(t *testing.T) { t.Run("route all traffic via client 1", func(t *testing.T) { aips := []wgcfg.CIDR{} aips = append(aips, c1NetMap.Addresses...) - aips = append(aips, *allZeros) + aips = append(aips, allZeros) affectedPeers, err := s.control.SetAllowedIPs(c1.nkey, aips) if err != nil { @@ -266,7 +266,7 @@ func TestControl(t *testing.T) { _ = c2NetMap foundAllZeros := false for _, cidr := range c2NetMap.Peers[0].AllowedIPs { - if cidr == *allZeros { + if cidr == allZeros { foundAllZeros = true } } @@ -292,7 +292,7 @@ func TestControl(t *testing.T) { foundAllZeros := false for _, cidr := range c2NetMap.Peers[0].AllowedIPs { - if cidr == *allZeros { + if cidr == allZeros { foundAllZeros = true } } diff --git a/go.mod b/go.mod index f723f943d..e4782b95d 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/peterbourgon/ff/v2 v2.0.0 github.com/tailscale/hujson v0.0.0-20190930033718-5098e564d9b3 // indirect github.com/tailscale/winipcfg-go v0.0.0-20200213045944-185b07f8233f - github.com/tailscale/wireguard-go v0.0.0-20200317013323-239518935266 + github.com/tailscale/wireguard-go v0.0.0-20200317153427-3c84b2e08219 golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4 golang.org/x/net v0.0.0-20200301022130-244492dfa37a // indirect golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d @@ -31,4 +31,3 @@ require ( honnef.co/go/tools v0.0.1-2020.1.3 // indirect rsc.io/goversion v1.2.0 ) - diff --git a/go.sum b/go.sum index 0a3c4d516..f9d929939 100644 --- a/go.sum +++ b/go.sum @@ -121,6 +121,10 @@ github.com/tailscale/wireguard-go v0.0.0-20200307073332-1d43cf6b424f/go.mod h1:J github.com/tailscale/wireguard-go v0.0.0-20200311005428-826dfc85c223/go.mod h1:JPm5cTfu1K+qDFRbiHy0sOlHUylYQbpl356sdYFD8V4= github.com/tailscale/wireguard-go v0.0.0-20200311172358-e98fb01bbec2 h1:Bwz1G3mEdi9AMRKn/TJIOX+NbUWLssas8QVMb+s6APg= github.com/tailscale/wireguard-go v0.0.0-20200311172358-e98fb01bbec2/go.mod h1:JPm5cTfu1K+qDFRbiHy0sOlHUylYQbpl356sdYFD8V4= +github.com/tailscale/wireguard-go v0.0.0-20200317013323-239518935266 h1:Dhtc6KmHWCBWukI47jywK+9vIxFQxFIL5qxSIgg7QdQ= +github.com/tailscale/wireguard-go v0.0.0-20200317013323-239518935266/go.mod h1:JPm5cTfu1K+qDFRbiHy0sOlHUylYQbpl356sdYFD8V4= +github.com/tailscale/wireguard-go v0.0.0-20200317153427-3c84b2e08219 h1:BMAPRagODduo1pqKYbE4i0ISAqx2h8IlQ77WxWIipl8= +github.com/tailscale/wireguard-go v0.0.0-20200317153427-3c84b2e08219/go.mod h1:JPm5cTfu1K+qDFRbiHy0sOlHUylYQbpl356sdYFD8V4= github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= diff --git a/ipn/prefs.go b/ipn/prefs.go index 015a8c202..5d977b224 100644 --- a/ipn/prefs.go +++ b/ipn/prefs.go @@ -113,7 +113,7 @@ func compareIPNets(a, b []wgcfg.CIDR) bool { return false } for i := range a { - if !a[i].IP.Equal(&b[i].IP) || a[i].Mask != b[i].Mask { + if !a[i].IP.Equal(b[i].IP) || a[i].Mask != b[i].Mask { return false } } diff --git a/ipn/prefs_test.go b/ipn/prefs_test.go index 2bfcb8f82..4f9c0fdb2 100644 --- a/ipn/prefs_test.go +++ b/ipn/prefs_test.go @@ -32,7 +32,7 @@ func TestPrefsEqual(t *testing.T) { if err != nil { panic(err) } - ns = append(ns, *n) + ns = append(ns, n) } return ns } diff --git a/tailcfg/tailcfg_test.go b/tailcfg/tailcfg_test.go index 3bca304c1..5587f4839 100644 --- a/tailcfg/tailcfg_test.go +++ b/tailcfg/tailcfg_test.go @@ -35,7 +35,7 @@ func TestHostinfoEqual(t *testing.T) { if err != nil { panic(err) } - ns = append(ns, *n) + ns = append(ns, n) } return ns } diff --git a/wgengine/magicsock/magicsock_test.go b/wgengine/magicsock/magicsock_test.go index 8628ddedd..ef183faea 100644 --- a/wgengine/magicsock/magicsock_test.go +++ b/wgengine/magicsock/magicsock_test.go @@ -189,7 +189,7 @@ func parseCIDR(t *testing.T, addr string) wgcfg.CIDR { if err != nil { t.Fatal(err) } - return *cidr + return cidr } func runDERP(t *testing.T) (s *derp.Server, addr string, cleanupFn func()) {