From 5299ac35a61466beeadec96d78fa3a5ce5625191 Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 13 May 2019 11:40:08 -0400 Subject: [PATCH] create NTCP2 ipv6 address --- libi2pd/RouterContext.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libi2pd/RouterContext.cpp b/libi2pd/RouterContext.cpp index 7f2b704d..8293f1fd 100644 --- a/libi2pd/RouterContext.cpp +++ b/libi2pd/RouterContext.cpp @@ -110,7 +110,17 @@ namespace i2p { bool published; i2p::config::GetOption("ntcp2.published", published); if (published) + { PublishNTCP2Address (port, true); + if (ipv6) + { + // add NTCP2 ipv6 address + std::string host = "::1"; + if (!i2p::config::IsDefault ("ntcp2.addressv6")) + i2p::config::GetOption ("ntcp2.addressv6", host); + m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, boost::asio::ip::address_v6::from_string (host), port); + } + } } } } @@ -517,7 +527,8 @@ namespace i2p { m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, host, port); bool ntcp; i2p::config::GetOption("ntcp", ntcp); - if (!ntcp) + bool ssu; i2p::config::GetOption("ssu", ssu); + if (!ntcp && ssu) { // we must publish SSU address auto mtu = i2p::util::net::GetMTU (host);