Browse Source

[reseed] skip records in reserved IP ranges, check Yggdrasil avalability if domain resolves in ygg address

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/1905/head
R4SAS 2 years ago
parent
commit
58ef08310d
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 16
      libi2pd/Reseed.cpp

16
libi2pd/Reseed.cpp

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2022, The PurpleI2P Project * Copyright (c) 2013-2023, The PurpleI2P Project
* *
* This file is part of Purple i2pd project and licensed under BSD3 * This file is part of Purple i2pd project and licensed under BSD3
* *
@ -687,8 +687,18 @@ namespace data
while (it != end) while (it != end)
{ {
boost::asio::ip::tcp::endpoint ep = *it; boost::asio::ip::tcp::endpoint ep = *it;
if ((ep.address ().is_v4 () && i2p::context.SupportsV4 ()) || if (
(ep.address ().is_v6 () && i2p::context.SupportsV6 ())) (
!i2p::util::net::IsInReservedRange(ep.address ()) && (
(ep.address ().is_v4 () && i2p::context.SupportsV4 ()) ||
(ep.address ().is_v6 () && i2p::context.SupportsV6 ())
)
) ||
(
i2p::util::net::IsYggdrasilAddress (ep.address ()) &&
i2p::context.SupportsMesh ()
)
)
{ {
s.lowest_layer().connect (ep, ecode); s.lowest_layer().connect (ep, ecode);
if (!ecode) if (!ecode)

Loading…
Cancel
Save