From c180abd7cf448f7d5f44447e8647c731ad4524da Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 30 Jul 2020 13:59:23 -0700 Subject: [PATCH] wgengine/magicsock: merge errClosed and errConnClosed --- wgengine/magicsock/magicsock.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 1aeb97b56..07e39ed7c 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -1531,7 +1531,7 @@ func (c *Conn) sendDiscoMessage(dst netaddr.IPPort, dstKey tailcfg.NodeKey, dstD c.mu.Lock() if c.closed { c.mu.Unlock() - return false, errClosed + return false, errConnClosed } var nonce [disco.NonceLen]byte if _, err := crand.Read(nonce[:]); err != nil { @@ -3497,5 +3497,3 @@ type ippCacheKey struct { // derpStr replaces DERP IPs in s with "derp-". func derpStr(s string) string { return strings.ReplaceAll(s, "127.3.3.40:", "derp-") } - -var errClosed = errors.New("conn is closed")