From 0370fb7632e7b96e180a99e152891331549536f1 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 12 Dec 2011 07:03:51 +0000 Subject: [PATCH] don't filter local peers received from a non-local tracker --- ChangeLog | 1 + src/torrent.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 034ed9b83..d9deeaecb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -99,6 +99,7 @@ incoming connection * 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 * fixed small memory leak in DHT diff --git a/src/torrent.cpp b/src/torrent.cpp index ce0f4edf1..1232fa8d7 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2616,7 +2616,14 @@ ctx->set_verify_callback(verify_function, ec); else { // 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); } }