aboutsummaryrefslogtreecommitdiffstats
path: root/device/allowedips_test.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-06-03 16:12:29 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-06-03 16:29:43 +0200
commit841756e328c743fec624e9259921ea6d815911d5 (patch)
tree6b31dc3cd2e7b6e86c38ed6a1b7a36c326ef064d /device/allowedips_test.go
parentdevice: remove nodes by peer in O(1) instead of O(n) (diff)
downloadwireguard-go-841756e328c743fec624e9259921ea6d815911d5.tar.xz
wireguard-go-841756e328c743fec624e9259921ea6d815911d5.zip
device: simplify allowedips lookup signature
The inliner should handle this for us. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/allowedips_test.go')
-rw-r--r--device/allowedips_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/device/allowedips_test.go b/device/allowedips_test.go
index cbd32cc..7701cde 100644
--- a/device/allowedips_test.go
+++ b/device/allowedips_test.go
@@ -102,14 +102,14 @@ func TestTrieIPv4(t *testing.T) {
}
assertEQ := func(peer *Peer, a, b, c, d byte) {
- p := allowedIPs.LookupIPv4([]byte{a, b, c, d})
+ p := allowedIPs.Lookup([]byte{a, b, c, d})
if p != peer {
t.Error("Assert EQ failed")
}
}
assertNEQ := func(peer *Peer, a, b, c, d byte) {
- p := allowedIPs.LookupIPv4([]byte{a, b, c, d})
+ p := allowedIPs.Lookup([]byte{a, b, c, d})
if p == peer {
t.Error("Assert NEQ failed")
}
@@ -208,7 +208,7 @@ func TestTrieIPv6(t *testing.T) {
addr = append(addr, expand(b)...)
addr = append(addr, expand(c)...)
addr = append(addr, expand(d)...)
- p := allowedIPs.LookupIPv6(addr)
+ p := allowedIPs.Lookup(addr)
if p != peer {
t.Error("Assert EQ failed")
}