Преглед на файлове

Limit the number of IPs we use from each DNS seeder

A risk exists where a malicious DNS seeder eclipses a node by returning an enormous number of IP addresses. In this commit we mitigate this risk by limiting the number of IP addresses addrman learns to 256 per DNS seeder.

GitHub-Pull: #12626
Rebased-From: 46e7f80
tags/v0.16.1
e0 преди 3 години
родител
ревизия
f60e84dba4
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2
    1
      src/net.cpp

+ 2
- 1
src/net.cpp Целия файл

@@ -1619,7 +1619,8 @@ void CConnman::ThreadDNSAddressSeed()
if (!resolveSource.SetInternal(host)) {
continue;
}
if (LookupHost(host.c_str(), vIPs, 0, true))
unsigned int nMaxIPs = 256; // Limits number of IPs learned from a DNS seed
if (LookupHost(host.c_str(), vIPs, nMaxIPs, true))
{
for (const CNetAddr& ip : vIPs)
{

Loading…
Отказ
Запис