From d91054b8f1651944a7ae5616948ec5244776c97f Mon Sep 17 00:00:00 2001 From: arvidn Date: Tue, 9 Feb 2016 19:09:53 -0500 Subject: [PATCH] forward port fix to ip_voter from RC_1_0 --- test/setup_transfer.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/setup_transfer.cpp b/test/setup_transfer.cpp index 209ab1468..d510817b2 100644 --- a/test/setup_transfer.cpp +++ b/test/setup_transfer.cpp @@ -49,6 +49,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/thread.hpp" #include "libtorrent/random.hpp" #include "libtorrent/torrent_info.hpp" +#include "libtorrent/broadcast_socket.hpp" // for supports_ipv6() #include #include @@ -88,10 +89,13 @@ void init_rand_address() address rand_v4() { - do { + address_v4 ret; + do + { g_addr += 0x3080ca; - } while (g_addr == 0); - return address_v4(g_addr); + ret = address_v4(g_addr); + } while (is_any(ret) || is_local(ret) || is_loopback(ret)); + return ret; } sha1_hash rand_hash()