From 5a317d312dd506f1990edd6cab75b9581c1d3f3d Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 13 Jan 2022 13:56:40 -0800 Subject: [PATCH] wgengine/magicsock: enable DERP Return Path Optimization (DRPO) Turning this on at the beginning of the 1.21.x dev cycle, for 1.22. Updates #150 Change-Id: I1de567cfe0be3df5227087de196ab88e60c9eb56 Signed-off-by: Brad Fitzpatrick --- wgengine/magicsock/magicsock.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index d72bf3bc2..ca89fc5bd 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -68,7 +68,7 @@ func useDerpRoute() bool { if v, ok := ob.Get(); ok { return v } - return false + return true // as of 1.21.x } // peerInfo is all the information magicsock tracks about a particular @@ -1584,6 +1584,8 @@ func (c *Conn) runDerpReader(ctx context.Context, derpFakeAddr netaddr.IPPort, d continue case derp.HealthMessage: health.SetDERPRegionHealth(regionID, m.Problem) + case derp.PeerGoneMessage: + c.removeDerpPeerRoute(key.NodePublic(m), regionID, dc) default: // Ignore. continue