mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
always specify mtu for ipv6 address
This commit is contained in:
parent
6320572917
commit
c0482319e5
@ -162,7 +162,7 @@ namespace i2p
|
|||||||
{
|
{
|
||||||
// create new address
|
// create new address
|
||||||
m_RouterInfo.AddNTCPAddress (host.to_string ().c_str (), port);
|
m_RouterInfo.AddNTCPAddress (host.to_string ().c_str (), port);
|
||||||
m_RouterInfo.AddSSUAddress (host.to_string ().c_str (), port, GetIdentHash ()); // TODO
|
m_RouterInfo.AddSSUAddress (host.to_string ().c_str (), port, GetIdentHash (), 1472); // TODO
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
if (updated)
|
if (updated)
|
||||||
|
@ -374,6 +374,14 @@ namespace data
|
|||||||
value[l] = 0;
|
value[l] = 0;
|
||||||
WriteString (value, properties);
|
WriteString (value, properties);
|
||||||
properties << ';';
|
properties << ';';
|
||||||
|
// write mtu
|
||||||
|
if (address.mtu)
|
||||||
|
{
|
||||||
|
WriteString ("mtu", properties);
|
||||||
|
properties << '=';
|
||||||
|
WriteString (boost::lexical_cast<std::string>(address.mtu), properties);
|
||||||
|
properties << ';';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
WriteString ("port", properties);
|
WriteString ("port", properties);
|
||||||
properties << '=';
|
properties << '=';
|
||||||
@ -466,11 +474,12 @@ namespace data
|
|||||||
addr.transportStyle = eTransportNTCP;
|
addr.transportStyle = eTransportNTCP;
|
||||||
addr.cost = 2;
|
addr.cost = 2;
|
||||||
addr.date = 0;
|
addr.date = 0;
|
||||||
|
addr.mtu = 0;
|
||||||
m_Addresses.push_back(addr);
|
m_Addresses.push_back(addr);
|
||||||
m_SupportedTransports |= addr.host.is_v6 () ? eNTCPV6 : eNTCPV4;
|
m_SupportedTransports |= addr.host.is_v6 () ? eNTCPV6 : eNTCPV4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RouterInfo::AddSSUAddress (const char * host, int port, const uint8_t * key)
|
void RouterInfo::AddSSUAddress (const char * host, int port, const uint8_t * key, int mtu)
|
||||||
{
|
{
|
||||||
Address addr;
|
Address addr;
|
||||||
addr.host = boost::asio::ip::address::from_string (host);
|
addr.host = boost::asio::ip::address::from_string (host);
|
||||||
@ -478,6 +487,7 @@ namespace data
|
|||||||
addr.transportStyle = eTransportSSU;
|
addr.transportStyle = eTransportSSU;
|
||||||
addr.cost = 10; // NTCP should have priority over SSU
|
addr.cost = 10; // NTCP should have priority over SSU
|
||||||
addr.date = 0;
|
addr.date = 0;
|
||||||
|
addr.mtu = mtu;
|
||||||
memcpy (addr.key, key, 32);
|
memcpy (addr.key, key, 32);
|
||||||
m_Addresses.push_back(addr);
|
m_Addresses.push_back(addr);
|
||||||
m_SupportedTransports |= addr.host.is_v6 () ? eNTCPV6 : eSSUV4;
|
m_SupportedTransports |= addr.host.is_v6 () ? eNTCPV6 : eSSUV4;
|
||||||
|
@ -101,7 +101,7 @@ namespace data
|
|||||||
const Address * GetSSUV6Address () const;
|
const Address * GetSSUV6Address () const;
|
||||||
|
|
||||||
void AddNTCPAddress (const char * host, int port);
|
void AddNTCPAddress (const char * host, int port);
|
||||||
void AddSSUAddress (const char * host, int port, const uint8_t * key);
|
void AddSSUAddress (const char * host, int port, const uint8_t * key, int mtu = 0);
|
||||||
bool AddIntroducer (const Address * address, uint32_t tag);
|
bool AddIntroducer (const Address * address, uint32_t tag);
|
||||||
bool RemoveIntroducer (const boost::asio::ip::udp::endpoint& e);
|
bool RemoveIntroducer (const boost::asio::ip::udp::endpoint& e);
|
||||||
void SetProperty (const char * key, const char * value);
|
void SetProperty (const char * key, const char * value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user