mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-23 15:45:36 +02:00
handle 'reservedrange' param properly
This commit is contained in:
parent
2ad26dd4c9
commit
ca9782dd0d
8 changed files with 36 additions and 31 deletions
libi2pd
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2023, The PurpleI2P Project
|
||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
||||
*
|
||||
* This file is part of Purple i2pd project and licensed under BSD3
|
||||
*
|
||||
|
@ -687,18 +687,16 @@ namespace data
|
|||
while (it != end)
|
||||
{
|
||||
boost::asio::ip::tcp::endpoint ep = *it;
|
||||
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 ()
|
||||
)
|
||||
)
|
||||
bool supported = false;
|
||||
if (!ep.address ().is_unspecified ())
|
||||
{
|
||||
if (ep.address ().is_v4 ())
|
||||
supported = i2p::context.SupportsV4 ();
|
||||
else if (ep.address ().is_v6 ())
|
||||
supported = i2p::util::net::IsYggdrasilAddress (ep.address ()) ?
|
||||
i2p::context.SupportsMesh () : i2p::context.SupportsV6 ();
|
||||
}
|
||||
if (supported)
|
||||
{
|
||||
s.lowest_layer().connect (ep, ecode);
|
||||
if (!ecode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue