From 72b3c10ebdb10872554c201dea6775db36f23fdd Mon Sep 17 00:00:00 2001 From: hagen Date: Wed, 3 Feb 2016 14:21:22 +0000 Subject: [PATCH] * fix updating address in RI --- Daemon.cpp | 4 ++-- RouterContext.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Daemon.cpp b/Daemon.cpp index 9887ee30..b9d8bd44 100644 --- a/Daemon.cpp +++ b/Daemon.cpp @@ -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)); } diff --git a/RouterContext.cpp b/RouterContext.cpp index 7b793d64..962cf3ee 100644 --- a/RouterContext.cpp +++ b/RouterContext.cpp @@ -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 |