mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 00:59:08 +01:00
specify actual mtu in our RI for i2pv6
This commit is contained in:
parent
f28376bf71
commit
7a976dd5f2
2 changed files with 8 additions and 1 deletions
|
@ -162,7 +162,13 @@ 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 (), 1472); // TODO
|
auto mtu = i2p::util::net::GetMTU (host);
|
||||||
|
if (mtu)
|
||||||
|
{
|
||||||
|
LogPrint ("Our v6 MTU=", mtu);
|
||||||
|
if (mtu > 1472) mtu = 1472;
|
||||||
|
}
|
||||||
|
m_RouterInfo.AddSSUAddress (host.to_string ().c_str (), port, GetIdentHash (), mtu ? mtu : 1472); // TODO
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
if (updated)
|
if (updated)
|
||||||
|
|
1
util.cpp
1
util.cpp
|
@ -411,6 +411,7 @@ namespace net
|
||||||
// loook for interface matching local address
|
// loook for interface matching local address
|
||||||
for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next)
|
for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next)
|
||||||
{
|
{
|
||||||
|
if (!ifa->ifa_addr) continue;
|
||||||
family = ifa->ifa_addr->sa_family;
|
family = ifa->ifa_addr->sa_family;
|
||||||
if (family == AF_INET && localAddress.is_v4 ())
|
if (family == AF_INET && localAddress.is_v4 ())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue