wgengine/magicsock: don't deadlock on shutdown if sending blocks.

Signed-off-by: David Anderson <[email protected]>
This commit is contained in:
David Anderson authored and Dave Anderson committed 2020-07-27 14:09:54 -07:00
1 parent 0249236cc0
commit 9265296b33
1 file changed
+5 -1
+5 -1
View File
@@ -713,7 +713,11 @@ func newPinger(t *testing.T, logf logger.Logf, src, dst *magicStack) (cleanup fu
// acceptable to test instead of "every ping must
// transit".
pkt := tuntest.Ping(dst.IP(t).IPAddr().IP, src.IP(t).IPAddr().IP)
src.tun.Outbound <- pkt
select {
case src.tun.Outbound <- pkt:
case <-ctx.Done():
return false
}
select {
case <-dst.tun.Inbound:
return true