From 2d59c968ca7f33daed7d2ebdb6acb2e7fde12bbd Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 6 Mar 2021 18:43:50 -0500 Subject: [PATCH] don't publish NTCP2 address connected through proxy --- daemon/Daemon.cpp | 5 +++++ libi2pd/RouterContext.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/daemon/Daemon.cpp b/daemon/Daemon.cpp index e33f3d6d..e03513a9 100644 --- a/daemon/Daemon.cpp +++ b/daemon/Daemon.cpp @@ -186,6 +186,11 @@ namespace util { bool published; i2p::config::GetOption("ntcp2.published", published); if (published) + { + std::string ntcp2proxy; i2p::config::GetOption("ntcp2.proxy", ntcp2proxy); + if (!ntcp2proxy.empty ()) published = false; + } + if (published) { uint16_t ntcp2port; i2p::config::GetOption("ntcp2.port", ntcp2port); if (!ntcp2port) ntcp2port = port; // use standard port diff --git a/libi2pd/RouterContext.cpp b/libi2pd/RouterContext.cpp index 663fc4e7..809c73db 100644 --- a/libi2pd/RouterContext.cpp +++ b/libi2pd/RouterContext.cpp @@ -84,7 +84,14 @@ namespace i2p NewNTCP2Keys (); bool ntcp2Published = false; if (ntcp2) + { i2p::config::GetOption("ntcp2.published", ntcp2Published); + if (ntcp2Published) + { + std::string ntcp2proxy; i2p::config::GetOption("ntcp2.proxy", ntcp2proxy); + if (!ntcp2proxy.empty ()) ntcp2Published = false; + } + } uint8_t caps = 0; if (ipv4) {