From b67c102fe5df93b502b788a0ad8c3013607ead4d Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Thu, 2 Jul 2015 11:58:26 +0100 Subject: [PATCH] Remove simple sleep from router accept --- router/router.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/router/router.go b/router/router.go index 141dfc38..1c7dcbb2 100644 --- a/router/router.go +++ b/router/router.go @@ -16,17 +16,12 @@ import ( ) const ( - macMaxAge = 10 * time.Minute // [1] - tcpAcceptDelay = 1 * time.Millisecond // [2] + macMaxAge = 10 * time.Minute // [1] ) // [1] should be greater than typical ARP cache expiries, i.e. > 3/2 * // /proc/sys/net/ipv4_neigh/*/base_reachable_time_ms on Linux -// [2] time to wait between accepting tcp connections. This guards -// against brute-force attacks on the password when encryption is in -// use. It is also a basic DoS defence. - type LogFrameFunc func(string, []byte, *layers.Ethernet) type Config struct { @@ -212,7 +207,6 @@ func (router *Router) listenTCP(localPort int) { continue } router.acceptTCP(tcpConn) - time.Sleep(tcpAcceptDelay) } }() }