forked from I2P_Developers/i2p.i2p
* Transport: Treat more IPs as local
25/8 - Hamachi (moved from 5/8 Nov. 2012) 2620:9b::/32 - Hamachi 0::/8 - Includes IPv4 compatibility addresses ::xxxx:xxxx
This commit is contained in:
@@ -120,9 +120,17 @@ public abstract class TransportUtil {
|
||||
if (a0 == 169 && a1 == 254) return false;
|
||||
// 5/8 allocated to RIPE (30 November 2010)
|
||||
//if ((addr[0]&0xFF) == 5) return false; // Hamachi
|
||||
// Hamachi moved to 25/8 Nov. 2012
|
||||
// Assigned to UK Ministry of Defence
|
||||
// http://blog.logmein.com/products/changes-to-hamachi-on-november-19th
|
||||
if (a0 == 25) return false;
|
||||
return true; // or at least possible to be true
|
||||
} else if (addr.length == 16) {
|
||||
if (allowIPv6) {
|
||||
// loopback, broadcast,
|
||||
// IPv4 compat ::xxxx:xxxx
|
||||
if (addr[0] == 0)
|
||||
return false;
|
||||
// disallow 2002::/16 (6to4 RFC 3056)
|
||||
if (addr[0] == 0x20 && addr[1] == 0x02)
|
||||
return false;
|
||||
@@ -133,6 +141,9 @@ public abstract class TransportUtil {
|
||||
// disallow 2001:0::/32 (Teredo RFC 4380)
|
||||
if (addr[0] == 0x20 && addr[1] == 0x01 && addr[2] == 0x00 && addr[3] == 0x00)
|
||||
return false;
|
||||
// Hamachi IPv6
|
||||
if (addr[0] == 0x26 && addr[1] == 0x20 && addr[2] == 0x00 && (addr[3] & 0xff) == 0x9b)
|
||||
return false;
|
||||
try {
|
||||
InetAddress ia = InetAddress.getByAddress(addr);
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user