diff --git a/derp/derp_server.go b/derp/derp_server.go index 53f7ec1aa..a83f7dbbe 100644 --- a/derp/derp_server.go +++ b/derp/derp_server.go @@ -26,7 +26,6 @@ import ( "golang.org/x/crypto/nacl/box" "golang.org/x/sync/errgroup" - "tailscale.com/disco" "tailscale.com/metrics" "tailscale.com/types/key" "tailscale.com/types/logger" @@ -52,13 +51,6 @@ type Server struct { // before failing when writing to a client. WriteTimeout time.Duration - // OnlyDisco controls whether, for tests, non-discovery packets - // are dropped. This is used by magicsock tests to verify that - // NAT traversal works (using DERP for out-of-band messaging) - // but the packets themselves aren't going via DERP. - OnlyDisco bool - _ [pad32bit]byte - privateKey key.Private publicKey key.Public logf logger.Logf @@ -559,11 +551,6 @@ func (c *sclient) handleFrameSendPacket(ft frameType, fl uint32) error { return fmt.Errorf("client %x: recvPacket: %v", c.key, err) } - if s.OnlyDisco && !disco.LooksLikeDiscoWrapper(contents) { - s.packetsDropped.Add(1) - return nil - } - var fwd PacketForwarder s.mu.Lock() dst := s.clients[dstKey] diff --git a/wgengine/magicsock/magicsock_test.go b/wgengine/magicsock/magicsock_test.go index 0b68d0248..643895eb2 100644 --- a/wgengine/magicsock/magicsock_test.go +++ b/wgengine/magicsock/magicsock_test.go @@ -69,11 +69,6 @@ func runDERPAndStun(t *testing.T, logf logger.Logf, l nettype.PacketListener, st t.Fatal(err) } d := derp.NewServer(serverPrivateKey, logf) - if l != (nettype.Std{}) { - // When using virtual networking, only allow DERP to forward - // discovery traffic, not actual packets. - d.OnlyDisco = false - } httpsrv := httptest.NewUnstartedServer(derphttp.Handler(d)) httpsrv.Config.ErrorLog = logger.StdLogger(logf)