mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
publish MTU for ipv6 SSU2 address. Max MTU of 1488 for SSU1
This commit is contained in:
parent
5c62726992
commit
1dd2bd0013
@ -421,16 +421,18 @@ namespace i2p
|
|||||||
!i2p::util::net::IsYggdrasilAddress (address->host))
|
!i2p::util::net::IsYggdrasilAddress (address->host))
|
||||||
{
|
{
|
||||||
address->host = host;
|
address->host = host;
|
||||||
if (host.is_v6 () && address->transportStyle == i2p::data::RouterInfo::eTransportSSU)
|
if (host.is_v6 () && (address->transportStyle == i2p::data::RouterInfo::eTransportSSU || address->IsSSU2 ()))
|
||||||
{
|
{
|
||||||
// update MTU
|
// update MTU
|
||||||
auto mtu = i2p::util::net::GetMTU (host);
|
auto mtu = i2p::util::net::GetMTU (host);
|
||||||
if (mtu)
|
if (mtu)
|
||||||
{
|
{
|
||||||
LogPrint (eLogDebug, "Router: Our v6 MTU=", mtu);
|
LogPrint (eLogDebug, "Router: Our v6 MTU=", mtu);
|
||||||
if (mtu > 1472) { // TODO: magic constant
|
int maxMTU = address->IsSSU2 () ? 1500 : 1488; // must be multiple of 16 for SSU1
|
||||||
mtu = 1472;
|
if (mtu > maxMTU)
|
||||||
LogPrint(eLogWarning, "Router: MTU dropped to upper limit of 1472 bytes");
|
{
|
||||||
|
mtu = maxMTU;
|
||||||
|
LogPrint(eLogWarning, "Router: MTU dropped to upper limit of ", maxMTU, " bytes");
|
||||||
}
|
}
|
||||||
if (address->ssu) address->ssu->mtu = mtu;
|
if (address->ssu) address->ssu->mtu = mtu;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user