don't filter local peers received from a non-local tracker

This commit is contained in:
Arvid Norberg 2011-12-12 07:03:51 +00:00
parent f5d2cf0519
commit 0370fb7632
2 changed files with 9 additions and 1 deletions

View File

@ -99,6 +99,7 @@
incoming connection incoming connection
* added more detailed instrumentation of the disk I/O thread * added more detailed instrumentation of the disk I/O thread
* don't filter local peers received from a non-local tracker
* fix python deadlock when using python extensions * fix python deadlock when using python extensions
* fixed small memory leak in DHT * fixed small memory leak in DHT

View File

@ -2616,7 +2616,14 @@ ctx->set_verify_callback(verify_function, ec);
else else
{ {
// ignore local addresses from the tracker (unless the tracker is local too) // ignore local addresses from the tracker (unless the tracker is local too)
if (is_local(a.address()) && !is_local(tracker_ip)) continue; // there are 2 reasons to allow this:
// 1. retrackers are popular in russia, where an ISP runs a tracker within
// the AS (but not on the local network) giving out peers only from the
// local network
// 2. it might make sense to have a tracker extension in the future where
// trackers records a peer's internal and external IP, and match up
// peers on the same local network
// if (is_local(a.address()) && !is_local(tracker_ip)) continue;
m_policy.add_peer(a, i->pid, peer_info::tracker, 0); m_policy.add_peer(a, i->pid, peer_info::tracker, 0);
} }
} }