wgengine/magicsock: use netaddr.MustParseIPPrefix

Delete our bespoke helper.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
pull/1874/head
Josh Bleecher Snyder 3 years ago
parent bc68e22c5b
commit e0bd3cc70c

@ -453,7 +453,7 @@ func makeConfigs(t *testing.T, addrs []netaddr.IPPort) []wgcfg.Config {
privKeys = append(privKeys, wgkey.Private(privKey))
addresses = append(addresses, []netaddr.IPPrefix{
parseCIDR(t, fmt.Sprintf("1.0.0.%d/32", i+1)),
netaddr.MustParseIPPrefix(fmt.Sprintf("1.0.0.%d/32", i+1)),
})
}
@ -481,15 +481,6 @@ func makeConfigs(t *testing.T, addrs []netaddr.IPPort) []wgcfg.Config {
return cfgs
}
func parseCIDR(t *testing.T, addr string) netaddr.IPPrefix {
t.Helper()
cidr, err := netaddr.ParseIPPrefix(addr)
if err != nil {
t.Fatal(err)
}
return cidr
}
// TestDeviceStartStop exercises the startup and shutdown logic of
// wireguard-go, which is intimately intertwined with magicsock's own
// lifecycle. We seem to be good at generating deadlocks here, so if

Loading…
Cancel
Save