mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-31 00:34:20 +00:00
send HolePunch back based on actual address type
This commit is contained in:
parent
3e873f88c9
commit
b9a2d5df02
@ -573,7 +573,8 @@ namespace transport
|
|||||||
LogPrint (eLogInfo, "SSU: Introduce new session to [", i2p::data::GetIdentHashAbbreviation (router->GetIdentHash ()),
|
LogPrint (eLogInfo, "SSU: Introduce new session to [", i2p::data::GetIdentHashAbbreviation (router->GetIdentHash ()),
|
||||||
"] through introducer ", introducer->iHost, ":", introducer->iPort);
|
"] through introducer ", introducer->iHost, ":", introducer->iPort);
|
||||||
session->WaitForIntroduction ();
|
session->WaitForIntroduction ();
|
||||||
if (i2p::context.GetRouterInfo ().HasUnreachableCap ()) // if we are unreachable. TODO: ipv4 and ipv6
|
if ((address->host.is_v4 () && i2p::context.GetStatus () == eRouterStatusFirewalled) ||
|
||||||
|
(address->host.is_v6 () && i2p::context.GetStatusV6 () == eRouterStatusFirewalled))
|
||||||
{
|
{
|
||||||
uint8_t buf[1];
|
uint8_t buf[1];
|
||||||
Send (buf, 0, remoteEndpoint); // send HolePunch
|
Send (buf, 0, remoteEndpoint); // send HolePunch
|
||||||
|
@ -681,7 +681,8 @@ namespace transport
|
|||||||
// we didn't have correct endpoint when sent relay request
|
// we didn't have correct endpoint when sent relay request
|
||||||
// now we do
|
// now we do
|
||||||
LogPrint (eLogInfo, "SSU: RelayReponse connecting to endpoint ", remoteEndpoint);
|
LogPrint (eLogInfo, "SSU: RelayReponse connecting to endpoint ", remoteEndpoint);
|
||||||
if (i2p::context.GetRouterInfo ().HasUnreachableCap ()) // if we are unreachable. TODO: ipv4 and ipv6
|
if ((remoteIP.is_v4 () && i2p::context.GetStatus () == eRouterStatusFirewalled) ||
|
||||||
|
(remoteIP.is_v6 () && i2p::context.GetStatusV6 () == eRouterStatusFirewalled))
|
||||||
m_Server.Send (buf, 0, remoteEndpoint); // send HolePunch
|
m_Server.Send (buf, 0, remoteEndpoint); // send HolePunch
|
||||||
// we assume that HolePunch has been sent by this time and our SessionRequest will go through
|
// we assume that HolePunch has been sent by this time and our SessionRequest will go through
|
||||||
m_Server.CreateDirectSession (it->second, remoteEndpoint, false);
|
m_Server.CreateDirectSession (it->second, remoteEndpoint, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user