From 44d71d1e424df6ffdd8efc111432012d43424899 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 30 Aug 2021 21:26:38 -0700 Subject: [PATCH] wgengine/magicsock: fix race in test shutdown, again. We were returning an error almost, but not quite like errConnClosed in a single codepath, which could still trip the panic on reconfig in the test logic. Signed-off-by: David Anderson --- wgengine/magicsock/magicsock.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 3ae72c32e..14c23c2d0 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -2819,7 +2819,7 @@ func (c *Conn) ParseEndpoint(endpointStr string) (conn.Endpoint, error) { c.mu.Lock() defer c.mu.Unlock() if c.closed { - return nil, errors.New("magicsock: Conn closed") + return nil, errConnClosed } node, ok := c.peerMap.nodeForNodeKey(tailcfg.NodeKey(pk)) if !ok {