From ace57d76272387d33025897cafc35ace9430b3a5 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 5 Feb 2021 13:36:05 -0800 Subject: [PATCH] wgengine/magicsock: set a dummy private key in benchmark. Magicsock started dropping all traffic internally when Tailscale is shut down, to avoid spurious wireguard logspam. This made the benchmark not receive anything. Setting a dummy private key is sufficient to get magicsock to pass traffic for benchmarking purposes. Fixes #1270. Signed-off-by: David Anderson --- wgengine/magicsock/magicsock_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/wgengine/magicsock/magicsock_test.go b/wgengine/magicsock/magicsock_test.go index 998b9bb27..094e73359 100644 --- a/wgengine/magicsock/magicsock_test.go +++ b/wgengine/magicsock/magicsock_test.go @@ -1440,6 +1440,7 @@ func BenchmarkReceiveFrom(b *testing.B) { }, }, }) + conn.SetPrivateKey(wgkey.Private{0: 1}) conn.CreateEndpoint([32]byte{1: 1}, "0000000000000000000000000000000000000000000000000000000000000001.disco.tailscale:12345") conn.addValidDiscoPathForTest(discoKey, netaddr.MustParseIPPort(sendConn.LocalAddr().String()))