From 58ef08310d29441db19f7ee4027b4855630dfd94 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Thu, 9 Mar 2023 15:48:15 +0000 Subject: [PATCH] [reseed] skip records in reserved IP ranges, check Yggdrasil avalability if domain resolves in ygg address Signed-off-by: R4SAS --- libi2pd/Reseed.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libi2pd/Reseed.cpp b/libi2pd/Reseed.cpp index 4a6e5a7e..f0a4cc29 100644 --- a/libi2pd/Reseed.cpp +++ b/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 * @@ -687,8 +687,18 @@ namespace data while (it != end) { boost::asio::ip::tcp::endpoint ep = *it; - if ((ep.address ().is_v4 () && i2p::context.SupportsV4 ()) || - (ep.address ().is_v6 () && i2p::context.SupportsV6 ())) + if ( + ( + !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); if (!ecode)