Skip to content

Commit

Permalink
don't compare first byte for yggdrasil addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Feb 7, 2023
1 parent d1c98c5 commit f29ef2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libi2pd/NTCP2.cpp
Expand Up @@ -702,7 +702,8 @@ namespace transport
return;
}
if (addr->IsPublishedNTCP2 () && m_RemoteEndpoint.address () != addr->host &&
(!m_RemoteEndpoint.address ().is_v6 () ||
(!m_RemoteEndpoint.address ().is_v6 () || i2p::util::net::IsYggdrasilAddress (m_RemoteEndpoint.address ()) ?
memcmp (m_RemoteEndpoint.address ().to_v6 ().to_bytes ().data () + 1, addr->host.to_v6 ().to_bytes ().data () + 1, 7) : // from the same yggdrasil subnet
memcmp (m_RemoteEndpoint.address ().to_v6 ().to_bytes ().data (), addr->host.to_v6 ().to_bytes ().data (), 8))) // temporary address
{
LogPrint (eLogError, "NTCP2: Host mismatch between published address ", addr->host, " and actual endpoint ", m_RemoteEndpoint.address ());
Expand Down

0 comments on commit f29ef2c

Please sign in to comment.