From d4986f878f7c67cc8ede7748a241a64fbcdbe950 Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Sun, 27 Aug 2017 15:35:26 -0700 Subject: [PATCH] treat unique local addresses as local These addresses are not globally routable so they should be considered local. --- src/broadcast_socket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/broadcast_socket.cpp b/src/broadcast_socket.cpp index 5fae36a6d..bea7ac3ee 100644 --- a/src/broadcast_socket.cpp +++ b/src/broadcast_socket.cpp @@ -71,7 +71,9 @@ namespace libtorrent { { return a.to_v6().is_loopback() || a.to_v6().is_link_local() - || a.to_v6().is_multicast_link_local(); + || a.to_v6().is_multicast_link_local() + // fc00::/7, unique local address + || (a.to_v6().to_bytes()[0] & 0xfe) == 0xfc; } #endif address_v4 a4 = a.to_v4();