all: update to wireguard-go API changes

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/189/head
Brad Fitzpatrick 5 years ago
parent dd14b658a2
commit e085aec8ef

@ -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)
}
}

@ -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)
}
}

@ -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
}
}

@ -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
)

@ -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=

@ -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
}
}

@ -32,7 +32,7 @@ func TestPrefsEqual(t *testing.T) {
if err != nil {
panic(err)
}
ns = append(ns, *n)
ns = append(ns, n)
}
return ns
}

@ -35,7 +35,7 @@ func TestHostinfoEqual(t *testing.T) {
if err != nil {
panic(err)
}
ns = append(ns, *n)
ns = append(ns, n)
}
return ns
}

@ -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()) {

Loading…
Cancel
Save