mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
pass NTCP2 ipv6 address
This commit is contained in:
parent
8753186a0d
commit
f0d4ee6618
@ -476,15 +476,12 @@ namespace i2p
|
||||
}
|
||||
}
|
||||
|
||||
if (!updated)
|
||||
if (!updated && port) // we have found NTCP2 v4 but not v6
|
||||
{
|
||||
if (port) // we have found NTCP2 v4 but not v6
|
||||
{
|
||||
m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv);
|
||||
PublishNTCP2Address (port, true);
|
||||
}
|
||||
m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, host, port);
|
||||
updated = true;
|
||||
}
|
||||
else
|
||||
if (updated)
|
||||
UpdateRouterInfo ();
|
||||
}
|
||||
|
||||
|
@ -696,12 +696,11 @@ namespace data
|
||||
m_Caps |= eSSUIntroducer;
|
||||
}
|
||||
|
||||
void RouterInfo::AddNTCP2Address (const uint8_t * staticKey, const uint8_t * iv)
|
||||
void RouterInfo::AddNTCP2Address (const uint8_t * staticKey, const uint8_t * iv, const boost::asio::ip::address& host, int port)
|
||||
{
|
||||
for (const auto& it: *m_Addresses) // don't insert one more NTCP2
|
||||
if (it->ntcp2) return;
|
||||
auto addr = std::make_shared<Address>();
|
||||
addr->port = 0;
|
||||
addr->host = host;
|
||||
addr->port = port;
|
||||
addr->transportStyle = eTransportNTCP;
|
||||
addr->cost = 3;
|
||||
addr->date = 0;
|
||||
|
@ -151,7 +151,7 @@ namespace data
|
||||
|
||||
void AddNTCPAddress (const char * host, int port);
|
||||
void AddSSUAddress (const char * host, int port, const uint8_t * key, int mtu = 0);
|
||||
void AddNTCP2Address (const uint8_t * staticKey, const uint8_t * iv);
|
||||
void AddNTCP2Address (const uint8_t * staticKey, const uint8_t * iv, const boost::asio::ip::address& host = boost::asio::ip::address(), int port = 0);
|
||||
bool AddIntroducer (const Introducer& introducer);
|
||||
bool RemoveIntroducer (const boost::asio::ip::udp::endpoint& e);
|
||||
void SetProperty (const std::string& key, const std::string& value); // called from RouterContext only
|
||||
|
Loading…
x
Reference in New Issue
Block a user