mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
fix ipv6 fallback address
This commit is contained in:
parent
ece140f18c
commit
73921b1024
2 changed files with 38 additions and 36 deletions
|
@ -295,7 +295,10 @@ namespace net
|
|||
{
|
||||
#ifdef WIN32
|
||||
LogPrint(eLogError, "NetIface: cannot get address by interface name, not implemented on WIN32");
|
||||
return boost::asio::ip::address::from_string("127.0.0.1");
|
||||
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);
|
||||
ifaddrs * addrs = nullptr;
|
||||
|
@ -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…
Add table
Add a link
Reference in a new issue