Browse Source

set proper caps if host is unspecified

pull/1883/head
orignal 2 years ago
parent
commit
289c308600
  1. 16
      libi2pd/RouterInfo.cpp

16
libi2pd/RouterInfo.cpp

@ -661,11 +661,16 @@ namespace data
addr->host = host; addr->host = host;
addr->port = port; addr->port = port;
addr->transportStyle = eTransportNTCP2; addr->transportStyle = eTransportNTCP2;
addr->caps = 0;
addr->date = 0; addr->date = 0;
addr->published = true; addr->published = true;
memcpy (addr->s, staticKey, 32); memcpy (addr->s, staticKey, 32);
memcpy (addr->i, iv, 16); memcpy (addr->i, iv, 16);
addr->caps = 0;
if (host.is_unspecified ())
{
if (host.is_v4 ()) addr->caps |= eV4;
if (host.is_v6 ()) addr->caps |= eV6;
}
if (addr->IsV4 ()) if (addr->IsV4 ())
{ {
m_SupportedTransports |= eNTCP2V4; m_SupportedTransports |= eNTCP2V4;
@ -737,12 +742,19 @@ namespace data
addr->host = host; addr->host = host;
addr->port = port; addr->port = port;
addr->published = true; addr->published = true;
addr->caps = i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer; // BC;
addr->date = 0; addr->date = 0;
addr->ssu.reset (new SSUExt ()); addr->ssu.reset (new SSUExt ());
addr->ssu->mtu = 0; addr->ssu->mtu = 0;
memcpy (addr->s, staticKey, 32); memcpy (addr->s, staticKey, 32);
memcpy (addr->i, introKey, 32); memcpy (addr->i, introKey, 32);
if (!host.is_unspecified ())
addr->caps = i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer; // BC;
else
{
addr->caps = 0;
if (host.is_v4 ()) addr->caps |= eV4;
if (host.is_v6 ()) addr->caps |= eV6;
}
if (addr->IsV4 ()) if (addr->IsV4 ())
{ {
m_SupportedTransports |= eSSU2V4; m_SupportedTransports |= eSSU2V4;

Loading…
Cancel
Save