mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 02:44:15 +00:00
process ipv6 addresses in SessionCreated
This commit is contained in:
parent
b6bc49c33a
commit
faf093c474
4
SSU.cpp
4
SSU.cpp
@ -208,7 +208,7 @@ namespace transport
|
|||||||
else // v6
|
else // v6
|
||||||
{
|
{
|
||||||
boost::asio::ip::address_v6::bytes_type bytes;
|
boost::asio::ip::address_v6::bytes_type bytes;
|
||||||
memcpy (bytes.data (), ourAddress, 6);
|
memcpy (bytes.data (), ourAddress, 16);
|
||||||
ourIP = boost::asio::ip::address_v6 (bytes);
|
ourIP = boost::asio::ip::address_v6 (bytes);
|
||||||
}
|
}
|
||||||
s.Insert (ourAddress, addressSize); // our IP
|
s.Insert (ourAddress, addressSize); // our IP
|
||||||
@ -221,7 +221,7 @@ namespace transport
|
|||||||
if (m_RemoteEndpoint.address ().is_v4 ())
|
if (m_RemoteEndpoint.address ().is_v4 ())
|
||||||
s.Insert (m_RemoteEndpoint.address ().to_v4 ().to_bytes ().data (), 4); // remote IP v4
|
s.Insert (m_RemoteEndpoint.address ().to_v4 ().to_bytes ().data (), 4); // remote IP v4
|
||||||
else
|
else
|
||||||
s.Insert (m_RemoteEndpoint.address ().to_v6 ().to_bytes ().data (), 6); // remote IP v6
|
s.Insert (m_RemoteEndpoint.address ().to_v6 ().to_bytes ().data (), 16); // remote IP v6
|
||||||
s.Insert (htobe16 (m_RemoteEndpoint.port ())); // remote port
|
s.Insert (htobe16 (m_RemoteEndpoint.port ())); // remote port
|
||||||
s.Insert (payload, 8); // relayTag and signed on time
|
s.Insert (payload, 8); // relayTag and signed on time
|
||||||
m_RelayTag = be32toh (*(uint32_t *)payload);
|
m_RelayTag = be32toh (*(uint32_t *)payload);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user