Browse Source

* fix updating address in RI

pull/358/head 2.4.0
hagen 9 years ago
parent
commit
72b3c10ebd
  1. 4
      Daemon.cpp
  2. 2
      RouterContext.cpp

4
Daemon.cpp

@ -90,9 +90,9 @@ namespace i2p
} }
std::string host; i2p::config::GetOption("host", host); std::string host; i2p::config::GetOption("host", host);
if (host != "") if (host != "0.0.0.0")
{ {
LogPrint(eLogInfo, "Daemon: address for incoming connections is ", host); LogPrint(eLogInfo, "Daemon: setting address for incoming connections to ", host);
i2p::context.UpdateAddress (boost::asio::ip::address::from_string (host)); i2p::context.UpdateAddress (boost::asio::ip::address::from_string (host));
} }

2
RouterContext.cpp

@ -48,6 +48,8 @@ namespace i2p
if (!port) if (!port)
port = rand () % (30777 - 9111) + 9111; // I2P network ports range port = rand () % (30777 - 9111) + 9111; // I2P network ports range
std::string host; i2p::config::GetOption("host", host); std::string host; i2p::config::GetOption("host", host);
if (host == "0.0.0.0")
host = "127.0.0.1"; // replace default address with safe value
routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash ()); routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash ());
routerInfo.AddNTCPAddress (host.c_str(), port); routerInfo.AddNTCPAddress (host.c_str(), port);
routerInfo.SetCaps (i2p::data::RouterInfo::eReachable | routerInfo.SetCaps (i2p::data::RouterInfo::eReachable |

Loading…
Cancel
Save