From f8adec5ee05728f0a11597237dbbc92d4fb73602 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 10 Mar 2014 05:53:49 +0000 Subject: [PATCH] merged enum_net fix from RC_0_16 --- src/enum_net.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/enum_net.cpp b/src/enum_net.cpp index 3ac379178..8986339ef 100644 --- a/src/enum_net.cpp +++ b/src/enum_net.cpp @@ -328,7 +328,10 @@ namespace libtorrent b2 = a2.to_v6().to_bytes(); m = mask.to_v6().to_bytes(); for (int i = 0; i < int(b1.size()); ++i) + { b1[i] &= m[i]; + b2[i] &= m[i]; + } return memcmp(&b1[0], &b2[0], b1.size()) == 0; } #endif @@ -343,7 +346,8 @@ namespace libtorrent for (std::vector::iterator i = net.begin() , end(net.end()); i != end; ++i) { - if (match_addr_mask(addr, i->interface_address, i->netmask)) return true; + if (match_addr_mask(addr, i->interface_address, i->netmask)) + return true; } return false; }