From 1dd2bd00139f09eb3f4d186c1998daaa35d75468 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 13 Jul 2022 15:52:19 -0400 Subject: [PATCH] publish MTU for ipv6 SSU2 address. Max MTU of 1488 for SSU1 --- libi2pd/RouterContext.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libi2pd/RouterContext.cpp b/libi2pd/RouterContext.cpp index b401b8c6..de845b3b 100644 --- a/libi2pd/RouterContext.cpp +++ b/libi2pd/RouterContext.cpp @@ -421,16 +421,18 @@ namespace i2p !i2p::util::net::IsYggdrasilAddress (address->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 auto mtu = i2p::util::net::GetMTU (host); if (mtu) { LogPrint (eLogDebug, "Router: Our v6 MTU=", mtu); - if (mtu > 1472) { // TODO: magic constant - mtu = 1472; - LogPrint(eLogWarning, "Router: MTU dropped to upper limit of 1472 bytes"); + int maxMTU = address->IsSSU2 () ? 1500 : 1488; // must be multiple of 16 for SSU1 + if (mtu > maxMTU) + { + mtu = maxMTU; + LogPrint(eLogWarning, "Router: MTU dropped to upper limit of ", maxMTU, " bytes"); } if (address->ssu) address->ssu->mtu = mtu; }