added early discarding of incoming connection attempt (before SSL handshake) for blacklisted IPs

This commit is contained in:
Cyril Soler 2016-06-02 09:36:50 -04:00
parent 617a863f12
commit 2f4f44ee48

View File

@ -35,6 +35,7 @@
#include "util/rsdebug.h"
#include "util/rsstring.h"
#include "retroshare/rsbanlist.h"
#include <unistd.h>
const int pqissllistenzone = 49787;
@ -373,6 +374,11 @@ int pqissllistenbase::acceptconnection()
#endif
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
if(rsBanList != NULL && !rsBanList->isAddressAccepted(remote_addr, RSBANLIST_CHECKING_FLAGS_BLACKLIST))
{
std::cerr << "(II) pqissllistenner::acceptConnection(): early denying connection attempt from blacklisted IP " << sockaddr_storage_iptostring(remote_addr) << std::endl;
return false ;
}
{
std::string out;
out += "Accepted Connection from ";