diff options
-rw-r--r-- | src/httpserver.cpp | 2 | ||||
-rw-r--r-- | src/netbase.cpp | 3 | ||||
-rw-r--r-- | src/rpc/net.cpp | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 069511563c..eb3f4a1c2b 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -682,7 +682,7 @@ CService HTTPRequest::GetPeer() const evhttp_connection_get_peer(con, (char**)&address, &port); #endif // HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - peer = LookupNumeric(address, port); + peer = MaybeFlipIPv6toCJDNS(LookupNumeric(address, port)); } return peer; } diff --git a/src/netbase.cpp b/src/netbase.cpp index 09b8a606b6..5e1e121bfe 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -653,9 +653,10 @@ bool LookupSubNet(const std::string& subnet_str, CSubNet& subnet_out) const size_t slash_pos{subnet_str.find_last_of('/')}; const std::string str_addr{subnet_str.substr(0, slash_pos)}; - const std::optional<CNetAddr> addr{LookupHost(str_addr, /*fAllowLookup=*/false)}; + std::optional<CNetAddr> addr{LookupHost(str_addr, /*fAllowLookup=*/false)}; if (addr.has_value()) { + addr = static_cast<CNetAddr>(MaybeFlipIPv6toCJDNS(CService{addr.value(), /*port=*/0})); if (slash_pos != subnet_str.npos) { const std::string netmask_str{subnet_str.substr(slash_pos + 1)}; uint8_t netmask; diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 07f61a084d..ec0eab52d1 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -730,7 +730,7 @@ static RPCHelpMan setban() if (!isSubnet) { const std::optional<CNetAddr> addr{LookupHost(request.params[0].get_str(), false)}; if (addr.has_value()) { - netAddr = addr.value(); + netAddr = static_cast<CNetAddr>(MaybeFlipIPv6toCJDNS(CService{addr.value(), /*port=*/0})); } } else |