1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-09 07:17:53 +00:00

ban abusing ipv6 addresses

This commit is contained in:
orignal 2015-02-10 15:54:07 -05:00
parent a27dd17cef
commit 3263f6fefc

View File

@ -901,6 +901,19 @@ namespace transport
if (!ec) if (!ec)
{ {
LogPrint (eLogInfo, "Connected from ", ep); LogPrint (eLogInfo, "Connected from ", ep);
auto it = m_BanList.find (ep.address ());
if (it != m_BanList.end ())
{
uint32_t ts = i2p::util::GetSecondsSinceEpoch ();
if (ts < it->second)
{
LogPrint (eLogInfo, ep.address (), " is banned for ", it->second - ts, " more seconds");
conn = nullptr;
}
else
m_BanList.erase (it);
}
if (conn)
conn->ServerLogin (); conn->ServerLogin ();
} }
else else