From 578083df3ef5ba5e2babd1a88e2b3a459a91e4a2 Mon Sep 17 00:00:00 2001 From: l-n-s Date: Fri, 28 Oct 2016 13:18:35 -0400 Subject: [PATCH 1/3] Add libdl (-ldl) flag. Fixes openssl errors when building statically. --- Makefile.linux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.linux b/Makefile.linux index 072fa685..28081c81 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -39,7 +39,7 @@ ifeq ($(USE_STATIC),yes) LDLIBS += $(LIBDIR)/libssl.a LDLIBS += $(LIBDIR)/libcrypto.a LDLIBS += $(LIBDIR)/libz.a - LDLIBS += -lpthread -static-libstdc++ -static-libgcc -lrt + LDLIBS += -lpthread -static-libstdc++ -static-libgcc -lrt -ldl USE_AESNI := no else LDLIBS = -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread From 4f4748b8dfdaba6563672adf5cd73908444fe2e9 Mon Sep 17 00:00:00 2001 From: l-n-s Date: Fri, 28 Oct 2016 15:57:18 -0400 Subject: [PATCH 2/3] Update nat option: if nat=false, skip reachability testing --- Config.cpp | 10 +--------- Transports.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Config.cpp b/Config.cpp index 924f244b..6a4c20d1 100644 --- a/Config.cpp +++ b/Config.cpp @@ -27,10 +27,6 @@ namespace config { variables_map m_Options; void Init() { - bool nat = true; -#ifdef MESHNET - nat = false; -#endif options_description general("General options"); general.add_options() @@ -45,7 +41,7 @@ namespace config { ("datadir", value()->default_value(""), "Path to storage of i2pd data (RI, keys, peer profiles, ...)") ("host", value()->default_value("0.0.0.0"), "External IP") ("ifname", value()->default_value(""), "network interface to bind to") - ("nat", value()->zero_tokens()->default_value(nat), "should we assume we are behind NAT?") + ("nat", value()->zero_tokens()->default_value(true), "should we assume we are behind NAT?") ("port", value()->default_value(0), "Port to listen for incoming connections (default: auto)") ("ipv4", value()->zero_tokens()->default_value(true), "Enable communication through ipv4") ("ipv6", value()->zero_tokens()->default_value(false), "Enable communication through ipv6") @@ -153,9 +149,6 @@ namespace config { reseed.add_options() ("reseed.verify", value()->default_value(false), "Verify .su3 signature") ("reseed.file", value()->default_value(""), "Path to .su3 file") -#ifdef MESHNET - ("reseed.urls", value()->default_value("https://reseed.i2p.rocks:8443/"), "Reseed URLs, separated by comma") -#else ("reseed.urls", value()->default_value( "https://reseed.i2p-projekt.de/," "https://i2p.mooo.com/netDb/," @@ -169,7 +162,6 @@ namespace config { "https://reseed-ru.lngserv.ru/," "https://reseed.atomike.ninja/" ), "Reseed URLs, separated by comma") -#endif ; options_description addressbook("AddressBook options"); diff --git a/Transports.cpp b/Transports.cpp index a29cac15..adb8da06 100644 --- a/Transports.cpp +++ b/Transports.cpp @@ -4,6 +4,7 @@ #include "I2NPProtocol.h" #include "NetDb.h" #include "Transports.h" +#include "Config.h" using namespace i2p::data; @@ -496,9 +497,9 @@ namespace transport { if (m_SSUServer) { -#ifndef MESHNET - i2p::context.SetStatus (eRouterStatusTesting); -#endif + bool nat; i2p::config::GetOption("nat", nat); + if (nat) + i2p::context.SetStatus (eRouterStatusTesting); for (int i = 0; i < 5; i++) { From df36b0eb7ea4406a0d0910b1794ff91aec86ac78 Mon Sep 17 00:00:00 2001 From: l-n-s Date: Fri, 28 Oct 2016 16:17:48 -0400 Subject: [PATCH 3/3] Uppercase first letters in config help --- Config.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Config.cpp b/Config.cpp index 6a4c20d1..8ac6d7d3 100644 --- a/Config.cpp +++ b/Config.cpp @@ -40,8 +40,8 @@ namespace config { ("family", value()->default_value(""), "Specify a family, router belongs to") ("datadir", value()->default_value(""), "Path to storage of i2pd data (RI, keys, peer profiles, ...)") ("host", value()->default_value("0.0.0.0"), "External IP") - ("ifname", value()->default_value(""), "network interface to bind to") - ("nat", value()->zero_tokens()->default_value(true), "should we assume we are behind NAT?") + ("ifname", value()->default_value(""), "Network interface to bind to") + ("nat", value()->zero_tokens()->default_value(true), "Should we assume we are behind NAT?") ("port", value()->default_value(0), "Port to listen for incoming connections (default: auto)") ("ipv4", value()->zero_tokens()->default_value(true), "Enable communication through ipv4") ("ipv6", value()->zero_tokens()->default_value(false), "Enable communication through ipv6") @@ -51,8 +51,8 @@ namespace config { ("notransit", value()->zero_tokens()->default_value(false), "Router will not accept transit tunnels at startup") ("floodfill", value()->zero_tokens()->default_value(false), "Router will be floodfill") ("bandwidth", value()->default_value(""), "Bandwidth limit: integer in kbps or letters: L (32), O (256), P (2048), X (>9000)") - ("ntcp", value()->zero_tokens()->default_value(true), "enable ntcp transport") - ("ssu", value()->zero_tokens()->default_value(true), "enable ssu transport") + ("ntcp", value()->zero_tokens()->default_value(true), "Enable NTCP transport") + ("ssu", value()->zero_tokens()->default_value(true), "Enable SSU transport") #ifdef _WIN32 ("svcctl", value()->default_value(""), "Windows service management ('install' or 'remove')") ("insomnia", value()->zero_tokens()->default_value(false), "Prevent system from sleeping") @@ -174,9 +174,9 @@ namespace config { options_description trust("Trust options"); trust.add_options() - ("trust.enabled", value()->default_value(false), "enable explicit trust options") + ("trust.enabled", value()->default_value(false), "Enable explicit trust options") ("trust.family", value()->default_value(""), "Router Familiy to trust for first hops") - ("trust.hidden", value()->default_value(false), "should we hide our router from other routers?"); + ("trust.hidden", value()->default_value(false), "Should we hide our router from other routers?"); m_OptionsDesc .add(general)