mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 06:54:15 +00:00
more precise compatibility check
This commit is contained in:
parent
6012585067
commit
1b8da90cbb
@ -1131,9 +1131,16 @@ namespace data
|
|||||||
return (bool)GetAddress (
|
return (bool)GetAddress (
|
||||||
[commonTransports](std::shared_ptr<const RouterInfo::Address> address)->bool
|
[commonTransports](std::shared_ptr<const RouterInfo::Address> address)->bool
|
||||||
{
|
{
|
||||||
// TODO:check v4 and v6 separately based on caps
|
if (address->IsPublishedNTCP2 ())
|
||||||
if ((commonTransports & (eNTCP2V4 | eNTCP2V6)) && address->IsPublishedNTCP2 ()) return true;
|
{
|
||||||
if ((commonTransports & (eSSUV4 | eSSUV6)) && address->IsReachableSSU ()) return true;
|
if ((commonTransports & eNTCP2V4) && address->IsV4 ()) return true;
|
||||||
|
if ((commonTransports & eNTCP2V6) && address->IsV6 ()) return true;
|
||||||
|
}
|
||||||
|
else if (address->IsReachableSSU ())
|
||||||
|
{
|
||||||
|
if ((commonTransports & eSSUV4) && address->IsV4 ()) return true;
|
||||||
|
if ((commonTransports & eSSUV6) && address->IsV6 ()) return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -130,8 +130,8 @@ namespace data
|
|||||||
|
|
||||||
bool IsCompatible (const boost::asio::ip::address& other) const
|
bool IsCompatible (const boost::asio::ip::address& other) const
|
||||||
{
|
{
|
||||||
return (host.is_v4 () && other.is_v4 ()) ||
|
return (IsV4 () && other.is_v4 ()) ||
|
||||||
(host.is_v6 () && other.is_v6 ());
|
(IsV6 () && other.is_v6 ());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Address& other) const
|
bool operator==(const Address& other) const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user