Skip to content

Commit

Permalink
* fix updating address in RI
Browse files Browse the repository at this point in the history
  • Loading branch information
hagen committed Feb 3, 2016
1 parent 62cec2a commit 72b3c10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ namespace i2p
}

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));
}

Expand Down
2 changes: 2 additions & 0 deletions RouterContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace i2p
if (!port)
port = rand () % (30777 - 9111) + 9111; // I2P network ports range
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.AddNTCPAddress (host.c_str(), port);
routerInfo.SetCaps (i2p::data::RouterInfo::eReachable |
Expand Down

0 comments on commit 72b3c10

Please sign in to comment.