From a0c89d9215c16a3921aa3a6d0aadf935611a01c7 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 2 Aug 2009 00:41:59 +0000 Subject: [PATCH] include self-assigned address range in what's considered 'local' --- src/broadcast_socket.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/broadcast_socket.cpp b/src/broadcast_socket.cpp index c1f90d5fe..c72c3bd2c 100644 --- a/src/broadcast_socket.cpp +++ b/src/broadcast_socket.cpp @@ -56,9 +56,10 @@ namespace libtorrent #endif address_v4 a4 = a.to_v4(); unsigned long ip = a4.to_ulong(); - return ((ip & 0xff000000) == 0x0a000000 - || (ip & 0xfff00000) == 0xac100000 - || (ip & 0xffff0000) == 0xc0a80000); + return ((ip & 0xff000000) == 0x0a000000 // 10.x.x.x + || (ip & 0xfff00000) == 0xac100000 // 172.16.x.x + || (ip & 0xffff0000) == 0xc0a80000 // 192.168.x.x + || (ip & 0xa9fe0000) == 0xa9fe0000); // 169.254.x.x } bool is_loopback(address const& addr)