override address if v6 only

This commit is contained in:
orignal 2016-07-22 10:34:56 -04:00
parent a4112ebed2
commit 6a1049bfb7

View File

@ -67,7 +67,9 @@ namespace i2p
if (ipv6)
{
std::string host = "::";
if (!ifname.empty())
if (!i2p::config::IsDefault("host") && !ipv4) // override if v6 only
i2p::config::GetOption("host", host);
else if (!ifname.empty())
host = i2p::util::net::GetInterfaceAddress(ifname, true).to_string(); // v6
routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash ());
routerInfo.AddNTCPAddress (host.c_str(), port);