From ddbae1da865fad908503c496eb2a8d1cca57078c Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 19 May 2012 20:39:55 +0000 Subject: [PATCH] don't accept incoming uTP connections indefinitely --- src/utp_socket_manager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utp_socket_manager.cpp b/src/utp_socket_manager.cpp index 729103a20..6865d86b7 100644 --- a/src/utp_socket_manager.cpp +++ b/src/utp_socket_manager.cpp @@ -245,6 +245,10 @@ namespace libtorrent // create a new utp_stream if (ph->get_type() == ST_SYN) { + // possible SYN flood. Just ignore + if (m_utp_sockets.size() > m_sett.connections_limit * 2) + return false; + // create the new socket with this ID m_new_connection = id;