MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / SetMTU

Method SetMTU

libi2pd/RouterContext.cpp:1083–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081 }
1082
1083 void RouterContext::SetMTU (int mtu, bool v4)
1084 {
1085 if (mtu < 1280 || mtu > 1500) return;
1086 auto addresses = m_RouterInfo.GetAddresses ();
1087 if (!addresses) return;
1088 for (auto& addr: *addresses)
1089 {
1090 if (addr && addr->ssu && ((v4 && addr->IsV4 ()) || (!v4 && addr->IsV6 ())))
1091 {
1092 addr->ssu->mtu = mtu;
1093 LogPrint (eLogDebug, "Router: MTU for ", v4 ? "ipv4" : "ipv6", " address ", addr->host.to_string(), " is set to ", mtu);
1094 }
1095 }
1096 }
1097
1098 void RouterContext::UpdateNTCP2V6Address (const boost::asio::ip::address& host)
1099 {

Callers 3

StartMethod · 0.80
SetLocalAddressMethod · 0.80
StartMethod · 0.80

Calls 5

LogPrintFunction · 0.85
GetAddressesMethod · 0.80
to_stringMethod · 0.80
IsV4Method · 0.45
IsV6Method · 0.45

Tested by

no test coverage detected