#2778 (IPv6 PEX accepts garbage addresses) -- accept petch from jch to reject IPv6 addresses outside of 2000::/3 until the end of the 13th Baktun
This commit is contained in:
parent
6ec226634f
commit
dcbb1ee872
|
@ -630,7 +630,13 @@ isMartianAddr( const struct tr_address * a )
|
||||||
const unsigned char * address = (const unsigned char*)&a->addr.addr6;
|
const unsigned char * address = (const unsigned char*)&a->addr.addr6;
|
||||||
return (address[0] == 0xFF) ||
|
return (address[0] == 0xFF) ||
|
||||||
(memcmp(address, zeroes, 15) == 0 &&
|
(memcmp(address, zeroes, 15) == 0 &&
|
||||||
(address[15] == 0 || address[15] == 1));
|
(address[15] == 0 || address[15] == 1)) ||
|
||||||
|
/* Addresses outside of 2000::/3 are currently reserved,
|
||||||
|
but might be allocated at some future time. Since
|
||||||
|
there are a lot of buggy peers pushing around such
|
||||||
|
addresses over PEX, we reject them until the end of
|
||||||
|
the 13th Baktun. */
|
||||||
|
(tr_time() < 1356130800 && (address[0] & 0xC0) != 0x20);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue