From 8bacfe6a37c390337a23d5c94a820b671476c2c7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 25 Aug 2021 23:53:17 -0700 Subject: [PATCH] wgengine/magicsock: remove unused sendLogLimit limiter. Magicsock these days gets its logs limited by the global log limiter. Signed-off-by: David Anderson --- wgengine/magicsock/magicsock.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 3a1e387ea..3ae72c32e 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -28,7 +28,6 @@ import ( "time" "golang.org/x/crypto/nacl/box" - "golang.org/x/time/rate" "golang.zx2c4.com/wireguard/conn" "inet.af/netaddr" "tailscale.com/control/controlclient" @@ -305,13 +304,6 @@ type Conn struct { // port mappings from NAT devices. portMapper *portmapper.Client - // sendLogLimit is a rate limiter for errors logged in the (hot) - // packet sending codepath. It's so that, if magicsock gets into a - // bad state, we don't spam one error per wireguard packet being - // transmitted. - // TODO(danderson): now that we have global rate-limiting, is this still useful? - sendLogLimit *rate.Limiter - // stunReceiveFunc holds the current STUN packet processing func. // Its Loaded value is always non-nil. stunReceiveFunc atomic.Value // of func(p []byte, fromAddr *net.UDPAddr) @@ -570,7 +562,6 @@ func (o *Options) derpActiveFunc() func() { // of NewConn. Mostly for tests. func newConn() *Conn { c := &Conn{ - sendLogLimit: rate.NewLimiter(rate.Every(1*time.Minute), 1), derpRecvCh: make(chan derpReadResult), derpStarted: make(chan struct{}), peerLastDerp: make(map[key.Public]int),