Browse Source

Squashed commit of the following:

commit 40ec4e8b59
Author: Simon Vetter <simon.vetter@runbox.com>
Date:   Fri Jul 30 21:23:27 2021 +0200

    libi2pd: mark additional ipv6 addresses/nets as reserved

    This adds :: (undefined address), ::1 (loopback address) as well as
    ff00::/8 (multicast prefix) to reservedIPv6Ranges.

    A bunch of nodes seem to be publishing bogus addresses (mostly ::1)
    in the netDB, resulting in unnecessary tunnel build failures.

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/1687/head
R4SAS 3 years ago
parent
commit
b3e7b1b5ac
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 5
      libi2pd/util.cpp

5
libi2pd/util.cpp

@ -555,7 +555,10 @@ namespace net
static const std::vector< std::pair<boost::asio::ip::address_v6::bytes_type, boost::asio::ip::address_v6::bytes_type> > reservedIPv6Ranges { static const std::vector< std::pair<boost::asio::ip::address_v6::bytes_type, boost::asio::ip::address_v6::bytes_type> > reservedIPv6Ranges {
address_pair_v6("2001:db8::", "2001:db8:ffff:ffff:ffff:ffff:ffff:ffff"), address_pair_v6("2001:db8::", "2001:db8:ffff:ffff:ffff:ffff:ffff:ffff"),
address_pair_v6("fc00::", "fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"), address_pair_v6("fc00::", "fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"),
address_pair_v6("fe80::", "febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff") address_pair_v6("fe80::", "febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff"),
address_pair_v6("ff00::", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"),
address_pair_v6("::", "::"),
address_pair_v6("::1", "::1")
}; };
boost::asio::ip::address_v6::bytes_type ipv6_address = host.to_v6 ().to_bytes (); boost::asio::ip::address_v6::bytes_type ipv6_address = host.to_v6 ().to_bytes ();

Loading…
Cancel
Save