Browse Source

set and check proxy status for ipv6 if presented

pull/1797/head
orignal 2 years ago
parent
commit
3e3f92c616
  1. 2
      libi2pd/RouterContext.cpp
  2. 10
      libi2pd/Transports.cpp

2
libi2pd/RouterContext.cpp

@ -463,7 +463,7 @@ namespace i2p @@ -463,7 +463,7 @@ namespace i2p
updated = true;
}
if (host.is_v6 () && address->IsV6 () && address->ssu &&
(!address->ssu->mtu || updated))
(!address->ssu->mtu || updated) && m_StatusV6 != eRouterStatusProxy)
{
// update MTU
auto mtu = i2p::util::net::GetMTU (host);

10
libi2pd/Transports.cpp

@ -167,6 +167,8 @@ namespace transport @@ -167,6 +167,8 @@ namespace transport
m_PeerTestTimer = new boost::asio::deadline_timer (*m_Service);
}
bool ipv4; i2p::config::GetOption("ipv4", ipv4);
bool ipv6; i2p::config::GetOption("ipv6", ipv6);
i2p::config::GetOption("nat", m_IsNAT);
m_X25519KeysPairSupplier.Start ();
m_IsRunning = true;
@ -190,6 +192,8 @@ namespace transport @@ -190,6 +192,8 @@ namespace transport
m_NTCP2Server->UseProxy(proxytype, proxyurl.host, proxyurl.port, proxyurl.user, proxyurl.pass);
i2p::context.SetStatus (eRouterStatusProxy);
if (ipv6)
i2p::context.SetStatusV6 (eRouterStatusProxy);
}
else
LogPrint(eLogError, "Transports: Unsupported NTCP2 proxy URL ", ntcp2proxy);
@ -227,7 +231,11 @@ namespace transport @@ -227,7 +231,11 @@ namespace transport
if (proxyurl.parse (ssu2proxy) && proxyurl.schema == "socks")
{
if (m_SSU2Server->SetProxy (proxyurl.host, proxyurl.port))
{
i2p::context.SetStatus (eRouterStatusProxy);
if (ipv6)
i2p::context.SetStatusV6 (eRouterStatusProxy);
}
else
LogPrint(eLogError, "Transports: Can't set SSU2 proxy ", ssu2proxy);
}
@ -237,7 +245,6 @@ namespace transport @@ -237,7 +245,6 @@ namespace transport
}
// bind to interfaces
bool ipv4; i2p::config::GetOption("ipv4", ipv4);
if (ipv4)
{
std::string address; i2p::config::GetOption("address4", address);
@ -254,7 +261,6 @@ namespace transport @@ -254,7 +261,6 @@ namespace transport
}
}
bool ipv6; i2p::config::GetOption("ipv6", ipv6);
if (ipv6)
{
std::string address; i2p::config::GetOption("address6", address);

Loading…
Cancel
Save