fix ipv6 fallback address

pull/1347/head
R4SAS 5 years ago
parent ece140f18c
commit 73921b1024

@ -79,7 +79,7 @@ namespace i2p
}
if (ipv6)
{
std::string host = "::";
std::string host = "::1";
if (!i2p::config::IsDefault("host") && !ipv4) // override if v6 only
i2p::config::GetOption("host", host);
else if (!ifname.empty())
@ -113,7 +113,6 @@ namespace i2p
PublishNTCP2Address (port, true);
}
}
}
void RouterContext::UpdateRouterInfo ()

@ -295,6 +295,9 @@ namespace net
{
#ifdef WIN32
LogPrint(eLogError, "NetIface: cannot get address by interface name, not implemented on WIN32");
if(ipv6)
return boost::asio::ip::address::from_string("::1");
else
return boost::asio::ip::address::from_string("127.0.0.1");
#else
int af = (ipv6 ? AF_INET6 : AF_INET);
@ -327,7 +330,7 @@ namespace net
std::string fallback;
if(ipv6)
{
fallback = "::";
fallback = "::1";
LogPrint(eLogWarning, "NetIface: cannot find ipv6 address for interface ", ifname);
} else {
fallback = "127.0.0.1";

Loading…
Cancel
Save