From ab4f187397accc65b0f5fedf5d01f0412415dd27 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Tue, 9 Apr 2024 22:47:23 +0100 Subject: net-p2p/monero: enable ipv6 by default --- .../monero-9999-dns-perform-AAAA-resolution.patch | 101 + ...ro-compatibility-with-legacy-IPv4-options.patch | 164 ++ ...onsistency-between-IPv4-port-and-IPv6-por.patch | 177 ++ ...ro-9999-net-define-IPv4-object-explicitly.patch | 2377 ++++++++++++++++++++ .../monero-9999-net-enable-IPv6-by-default.patch | 496 ++++ 5 files changed, 3315 insertions(+) create mode 100644 net-p2p/monero/files/monero-9999-dns-perform-AAAA-resolution.patch create mode 100644 net-p2p/monero/files/monero-9999-net-add-retro-compatibility-with-legacy-IPv4-options.patch create mode 100644 net-p2p/monero/files/monero-9999-net-bring-consistency-between-IPv4-port-and-IPv6-por.patch create mode 100644 net-p2p/monero/files/monero-9999-net-define-IPv4-object-explicitly.patch create mode 100644 net-p2p/monero/files/monero-9999-net-enable-IPv6-by-default.patch (limited to 'net-p2p/monero/files') diff --git a/net-p2p/monero/files/monero-9999-dns-perform-AAAA-resolution.patch b/net-p2p/monero/files/monero-9999-dns-perform-AAAA-resolution.patch new file mode 100644 index 00000000..9deea952 --- /dev/null +++ b/net-p2p/monero/files/monero-9999-dns-perform-AAAA-resolution.patch @@ -0,0 +1,101 @@ +From a57141b6aabf44c33cfa57677774defb1f40c64a Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sun, 17 Jul 2022 23:52:34 +0100 +Subject: [PATCH] dns: perform AAAA resolution + +Address backlog item to resolve IPv6 address in addition to IPv4 +address. + +See: https://github.com/monero-project/monero/issues/8818 +--- + src/debug_utilities/dns_checks.cpp | 4 +++- + src/p2p/net_node.inl | 27 ++++++++++++++++++++++++--- + 2 files changed, 27 insertions(+), 4 deletions(-) + +diff --git a/src/debug_utilities/dns_checks.cpp b/src/debug_utilities/dns_checks.cpp +index a59a08209901..eebb35fc5be1 100644 +--- a/src/debug_utilities/dns_checks.cpp ++++ b/src/debug_utilities/dns_checks.cpp +@@ -42,7 +42,7 @@ + + namespace po = boost::program_options; + +-enum lookup_t { LOOKUP_A, LOOKUP_TXT }; ++enum lookup_t { LOOKUP_A, LOOKUP_AAAA, LOOKUP_TXT }; + + static std::vector lookup(lookup_t type, const char *hostname) + { +@@ -51,6 +51,7 @@ static std::vector lookup(lookup_t type, const char *hostname) + switch (type) + { + case LOOKUP_A: res = tools::DNSResolver::instance().get_ipv4(hostname, dnssec_available, dnssec_valid); break; ++ case LOOKUP_AAAA: res = tools::DNSResolver::instance().get_ipv6(hostname, dnssec_available, dnssec_valid); break; + case LOOKUP_TXT: res = tools::DNSResolver::instance().get_txt_record(hostname, dnssec_available, dnssec_valid); break; + default: MERROR("Invalid lookup type: " << (int)type); return {}; + } +@@ -130,6 +131,7 @@ int main(int argc, char* argv[]) + mlog_set_categories("+" MONERO_DEFAULT_LOG_CATEGORY ":INFO"); + + lookup(LOOKUP_A, {"seeds.moneroseeds.se", "seeds.moneroseeds.ae.org", "seeds.moneroseeds.ch", "seeds.moneroseeds.li"}); ++ lookup(LOOKUP_AAAA, {"seeds.moneroseeds.se", "seeds.moneroseeds.ae.org", "seeds.moneroseeds.ch", "seeds.moneroseeds.li"}); + + lookup(LOOKUP_TXT, {"updates.moneropulse.org", "updates.moneropulse.net", "updates.moneropulse.co", "updates.moneropulse.se", "updates.moneropulse.fr", "updates.moneropulse.de", "updates.moneropulse.no", "updates.moneropulse.ch"}); + +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 1a43c8ac2ad1..f357c6037800 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -779,8 +779,6 @@ namespace nodetool + + // for each hostname in the seed nodes list, attempt to DNS resolve and + // add the result addresses as seed nodes +- // TODO: at some point add IPv6 support, but that won't be relevant +- // for some time yet. + + std::vector> dns_results; + dns_results.resize(m_seed_nodes_list.size()); +@@ -802,10 +800,12 @@ namespace nodetool + // TODO: care about dnssec avail/valid + bool avail, valid; + std::vector addr_list; ++ std::vector addr_list_ipv4; ++ std::vector addr_list_ipv6; + + try + { +- addr_list = tools::DNSResolver::instance().get_ipv4(addr_str, avail, valid); ++ addr_list_ipv4 = tools::DNSResolver::instance().get_ipv4(addr_str, avail, valid); + MDEBUG("dns_threads[" << result_index << "] DNS resolve done"); + boost::this_thread::interruption_point(); + } +@@ -815,9 +815,30 @@ namespace nodetool + // even if we now have results, finish thread without setting + // result variables, which are now out of scope in main thread + MWARNING("dns_threads[" << result_index << "] interrupted"); ++ } ++ ++ try ++ { ++ addr_list_ipv6 = tools::DNSResolver::instance().get_ipv6(addr_str, avail, valid); ++ MDEBUG("dns_threads[" << result_index << "] DNS resolve done"); ++ boost::this_thread::interruption_point(); ++ } ++ catch(const boost::thread_interrupted&) ++ { ++ // thread interruption request ++ // even if we now have results, finish thread without setting ++ // result variables, which are now out of scope in main thread ++ MWARNING("dns_threads[" << result_index << "] interrupted"); ++ } ++ ++ if (addr_list_ipv4.empty() && addr_list_ipv6.empty()) ++ { + return; + } + ++ addr_list.insert(addr_list.end(), addr_list_ipv4.begin(), addr_list_ipv4.end()); ++ addr_list.insert(addr_list.end(), addr_list_ipv6.begin(), addr_list_ipv6.end()); ++ + MINFO("dns_threads[" << result_index << "] addr_str: " << addr_str << " number of results: " << addr_list.size()); + dns_results[result_index] = addr_list; + }); diff --git a/net-p2p/monero/files/monero-9999-net-add-retro-compatibility-with-legacy-IPv4-options.patch b/net-p2p/monero/files/monero-9999-net-add-retro-compatibility-with-legacy-IPv4-options.patch new file mode 100644 index 00000000..c0fcb22c --- /dev/null +++ b/net-p2p/monero/files/monero-9999-net-add-retro-compatibility-with-legacy-IPv4-options.patch @@ -0,0 +1,164 @@ +From 4175d5b8d5c89a0617c0686c3e18d81286a43471 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 4 Apr 2024 22:33:16 +0100 +Subject: [PATCH] net: add retro compatibility with legacy IPv4 options + +To ensure retro compatibility, legacy IPv4 daemon arguments and +configuration settings changes are marked as deprecated, but can still +be used falling back to new option name when new options are not used. + +Raise warning in case legacy option are used. + +* --p2p-bind-ip is an alias to --p2p-bind-ipv4-address +* --p2p-bind-port is an alias to --p2p-bind-ipv4-port +* --p2p-bind-port-ipv6 is an alias to --p2p-bind-ipv6-port +* --rpc-bind-ip is an alias to --rpc-bind-ipv4-address +* --rpc-restricted-bind-ip is an alias to --rpc-restricted-bind-ipv4-address +--- + src/p2p/net_node.cpp | 3 +++ + src/p2p/net_node.h | 3 +++ + src/p2p/net_node.inl | 22 ++++++++++++++++++++++ + src/rpc/rpc_args.cpp | 17 +++++++++++++++++ + src/rpc/rpc_args.h | 2 ++ + 5 files changed, 47 insertions(+) + +diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp +index bb7965817dee..4d5ba6e38268 100644 +--- a/src/p2p/net_node.cpp ++++ b/src/p2p/net_node.cpp +@@ -113,6 +113,7 @@ namespace nodetool + { + const command_line::arg_descriptor arg_p2p_bind_ipv4_address = {"p2p-bind-ipv4-address", "Interface for p2p network protocol (IPv4)", "0.0.0.0"}; + const command_line::arg_descriptor arg_p2p_bind_ipv6_address = {"p2p-bind-ipv6-address", "Interface for p2p network protocol (IPv6)", "::"}; ++ const command_line::arg_descriptor arg_p2p_bind_ip = {"p2p-bind-ip", "DEPRECATED: replaced with --p2p-bind-ipv4-address", ""}; + const command_line::arg_descriptor arg_p2p_bind_ipv4_port = { + "p2p-bind-ipv4-port" + , "Port for p2p network protocol (IPv4)" +@@ -139,6 +140,8 @@ namespace nodetool + return val; + } + }; ++ const command_line::arg_descriptor arg_p2p_bind_port = {"p2p-bind-port", "DEPRECATED: replaced with --p2p-bind-ipv4-port", ""}; ++ const command_line::arg_descriptor arg_p2p_bind_port_ipv6 = {"p2p-bind-port-ipv6", "DEPRECATED: replaced with --p2p-bind-ipv6-port", ""}; + + const command_line::arg_descriptor arg_p2p_external_port = {"p2p-external-port", "External port for p2p network protocol (if port forwarding used with NAT)", 0}; + const command_line::arg_descriptor arg_p2p_allow_local_ip = {"allow-local-ip", "Allow local ip add to peer list, mostly in debug purposes"}; +diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h +index a373c80a3575..4db6a107ca0a 100644 +--- a/src/p2p/net_node.h ++++ b/src/p2p/net_node.h +@@ -522,8 +522,11 @@ namespace nodetool + const int64_t default_limit_down = P2P_DEFAULT_LIMIT_RATE_DOWN; // kB/s + extern const command_line::arg_descriptor arg_p2p_bind_ipv4_address; + extern const command_line::arg_descriptor arg_p2p_bind_ipv6_address; ++ extern const command_line::arg_descriptor arg_p2p_bind_ip; // DEPRECATED + extern const command_line::arg_descriptor arg_p2p_bind_ipv4_port; + extern const command_line::arg_descriptor arg_p2p_bind_ipv6_port; ++ extern const command_line::arg_descriptor arg_p2p_bind_port; // DEPRECATED ++ extern const command_line::arg_descriptor arg_p2p_bind_port_ipv6; // DEPRECATED + extern const command_line::arg_descriptor arg_p2p_use_ipv6; + extern const command_line::arg_descriptor arg_p2p_ignore_ipv4; + extern const command_line::arg_descriptor arg_p2p_external_port; +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index f50ac8ea22d5..1a43c8ac2ad1 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -101,8 +101,11 @@ namespace nodetool + { + command_line::add_arg(desc, arg_p2p_bind_ipv4_address); + command_line::add_arg(desc, arg_p2p_bind_ipv6_address); ++ command_line::add_arg(desc, arg_p2p_bind_ip); // DEPRECATED + command_line::add_arg(desc, arg_p2p_bind_ipv4_port, false); + command_line::add_arg(desc, arg_p2p_bind_ipv6_port, false); ++ command_line::add_arg(desc, arg_p2p_bind_port, false); // DEPRECATED ++ command_line::add_arg(desc, arg_p2p_bind_port_ipv6, false); // DEPRECATED + command_line::add_arg(desc, arg_p2p_use_ipv6); + command_line::add_arg(desc, arg_p2p_ignore_ipv4); + command_line::add_arg(desc, arg_p2p_external_port); +@@ -416,6 +419,25 @@ namespace nodetool + public_zone.m_bind_ipv6_address = command_line::get_arg(vm, arg_p2p_bind_ipv6_address); + public_zone.m_port_ipv4 = command_line::get_arg(vm, arg_p2p_bind_ipv4_port); + public_zone.m_port_ipv6 = command_line::get_arg(vm, arg_p2p_bind_ipv6_port); ++ ++ // DEPRECATED --p2p-bind-ip ++ if (!command_line::get_arg(vm, arg_p2p_bind_ip).empty()) ++ MWARNING("--p2p-bind-ip is now DEPRECATED, replace with --p2p-bind-ipv4-address"); ++ if (public_zone.m_bind_ipv4_address.empty()) ++ public_zone.m_bind_ipv4_address = command_line::get_arg(vm, arg_p2p_bind_ip); ++ ++ // DEPRECATED --p2p-bind-port ++ if (!command_line::get_arg(vm, arg_p2p_bind_port).empty()) ++ MWARNING("--p2p-bind-port is now DEPRECATED, replace with --p2p-bind-ipv4-port"); ++ if (public_zone.m_port_ipv4.empty()) ++ public_zone.m_port_ipv4 = command_line::get_arg(vm, arg_p2p_bind_port); ++ ++ // DEPRECATED --p2p-bind-port-ipv6 ++ if (!command_line::get_arg(vm, arg_p2p_bind_port_ipv6).empty()) ++ MWARNING("--p2p-bind-port-ipv6 is now DEPRECATED, replace with --p2p-bind-ipv6-port"); ++ if (public_zone.m_port_ipv6.empty()) ++ public_zone.m_port_ipv6 = command_line::get_arg(vm, arg_p2p_bind_ipv6_port); ++ + public_zone.m_can_pingback = true; + m_external_port = command_line::get_arg(vm, arg_p2p_external_port); + m_allow_local_ip = command_line::get_arg(vm, arg_p2p_allow_local_ip); +diff --git a/src/rpc/rpc_args.cpp b/src/rpc/rpc_args.cpp +index 3e4503b20678..4d0411b503d5 100644 +--- a/src/rpc/rpc_args.cpp ++++ b/src/rpc/rpc_args.cpp +@@ -91,8 +91,10 @@ namespace cryptonote + rpc_args::descriptors::descriptors() + : rpc_bind_ipv4_address({"rpc-bind-ipv4-address", rpc_args::tr("Specify IPv4 address to bind RPC server"), "127.0.0.1"}) + , rpc_bind_ipv6_address({"rpc-bind-ipv6-address", rpc_args::tr("Specify IPv6 address to bind RPC server"), "::1"}) ++ , rpc_bind_ip({"rpc-bind-ip", rpc_args::tr("DEPRECATED: replaced with --rpc-bind-ipv4-address"), ""}) + , rpc_restricted_bind_ipv4_address({"rpc-restricted-bind-ipv4-address", rpc_args::tr("Specify IPv4 address to bind restricted RPC server"), "127.0.0.1"}) + , rpc_restricted_bind_ipv6_address({"rpc-restricted-bind-ipv6-address", rpc_args::tr("Specify IPv6 address to bind restricted RPC server"), "::1"}) ++ , rpc_restricted_bind_ip({"rpc-restricted-bind-ip", rpc_args::tr("DEPRECATED: replaced with --rpc-restricted-bind-ipv4-address"), ""}) + , rpc_use_ipv6({"rpc-use-ipv6", rpc_args::tr("Allow IPv6 for RPC"), false}) + , rpc_ignore_ipv4({"rpc-ignore-ipv4", rpc_args::tr("Ignore unsuccessful IPv4 bind for RPC"), false}) + , rpc_login({"rpc-login", rpc_args::tr("Specify username[:password] required for RPC server"), "", true}) +@@ -115,8 +117,10 @@ namespace cryptonote + const descriptors arg{}; + command_line::add_arg(desc, arg.rpc_bind_ipv4_address); + command_line::add_arg(desc, arg.rpc_bind_ipv6_address); ++ command_line::add_arg(desc, arg.rpc_bind_ip); // DEPRECATED + command_line::add_arg(desc, arg.rpc_restricted_bind_ipv4_address); + command_line::add_arg(desc, arg.rpc_restricted_bind_ipv6_address); ++ command_line::add_arg(desc, arg.rpc_restricted_bind_ip); // DEPRECATED + command_line::add_arg(desc, arg.rpc_use_ipv6); + command_line::add_arg(desc, arg.rpc_ignore_ipv4); + command_line::add_arg(desc, arg.rpc_login); +@@ -142,6 +146,19 @@ namespace cryptonote + config.bind_ipv6_address = command_line::get_arg(vm, arg.rpc_bind_ipv6_address); + config.restricted_bind_ipv4_address = command_line::get_arg(vm, arg.rpc_restricted_bind_ipv4_address); + config.restricted_bind_ipv6_address = command_line::get_arg(vm, arg.rpc_restricted_bind_ipv6_address); ++ ++ // DEPRECATED --rpc-bind-ip ++ if (!command_line::get_arg(vm, arg.rpc_bind_ip).empty()) ++ MWARNING("--rpc-bind-ip is now DEPRECATED, replace with --rpc-bind-ipv4-address"); ++ if (config.bind_ipv4_address.empty()) ++ config.bind_ipv4_address = command_line::get_arg(vm, arg.rpc_bind_ip); ++ ++ // DEPRECATED --rpc-restricted-bind-ip ++ if (!command_line::get_arg(vm, arg.rpc_restricted_bind_ip).empty()) ++ MWARNING("--rpc-restricted-bind-ip is now DEPRECATED, replace with --rpc-restricted-bind-ipv4-address"); ++ if (config.restricted_bind_ipv4_address.empty()) ++ config.restricted_bind_ipv4_address = command_line::get_arg(vm, arg.rpc_restricted_bind_ip); ++ + config.use_ipv6 = command_line::get_arg(vm, arg.rpc_use_ipv6); + config.require_ipv4 = !command_line::get_arg(vm, arg.rpc_ignore_ipv4); + config.disable_rpc_ban = command_line::get_arg(vm, arg.disable_rpc_ban); +diff --git a/src/rpc/rpc_args.h b/src/rpc/rpc_args.h +index b4fa3ced09a4..392e78703839 100644 +--- a/src/rpc/rpc_args.h ++++ b/src/rpc/rpc_args.h +@@ -53,8 +53,10 @@ namespace cryptonote + + const command_line::arg_descriptor rpc_bind_ipv4_address; + const command_line::arg_descriptor rpc_bind_ipv6_address; ++ const command_line::arg_descriptor rpc_bind_ip; // DEPRECATED + const command_line::arg_descriptor rpc_restricted_bind_ipv4_address; + const command_line::arg_descriptor rpc_restricted_bind_ipv6_address; ++ const command_line::arg_descriptor rpc_restricted_bind_ip; // DEPRECATED + const command_line::arg_descriptor rpc_use_ipv6; + const command_line::arg_descriptor rpc_ignore_ipv4; + const command_line::arg_descriptor rpc_login; diff --git a/net-p2p/monero/files/monero-9999-net-bring-consistency-between-IPv4-port-and-IPv6-por.patch b/net-p2p/monero/files/monero-9999-net-bring-consistency-between-IPv4-port-and-IPv6-por.patch new file mode 100644 index 00000000..79d21307 --- /dev/null +++ b/net-p2p/monero/files/monero-9999-net-bring-consistency-between-IPv4-port-and-IPv6-por.patch @@ -0,0 +1,177 @@ +From 95a435a9c9d5d0ebec91e7bec5d7d2762ae124ae Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 4 Apr 2024 22:33:16 +0100 +Subject: [PATCH] net: bring consistency between IPv4 port and IPv6 port + +* --p2p-bind-port-ipv4 is replaced with --p2p-bind-ipv4-port +* --p2p-bind-port-ipv6 is replaced with --p2p-bind-ipv6-port +--- + Dockerfile | 2 +- + src/p2p/net_node.cpp | 8 ++++---- + src/p2p/net_node.h | 4 ++-- + src/p2p/net_node.inl | 8 ++++---- + tests/functional_tests/functional_tests_rpc.py | 2 +- + tests/trezor/daemon.cpp | 6 +++--- + tests/unit_tests/node_server.cpp | 4 ++-- + utils/fish/monerod.fish | 4 ++-- + 8 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/Dockerfile b/Dockerfile +index 6058eabadc46..106d07a2bf4b 100644 +--- a/Dockerfile ++++ b/Dockerfile +@@ -62,5 +62,5 @@ EXPOSE 18081 + USER monero + + ENTRYPOINT ["monerod"] +-CMD ["--p2p-bind-ipv4-address=0.0.0.0", "--p2p-bind-port-ipv4=18080", "--rpc-bind-ipv4-address=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--confirm-external-bind"] ++CMD ["--p2p-bind-ipv4-address=0.0.0.0", "--p2p-bind-ipv4-port=18080", "--rpc-bind-ipv4-address=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--confirm-external-bind"] + +diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp +index 635ab41ea6b7..bb7965817dee 100644 +--- a/src/p2p/net_node.cpp ++++ b/src/p2p/net_node.cpp +@@ -113,8 +113,8 @@ namespace nodetool + { + const command_line::arg_descriptor arg_p2p_bind_ipv4_address = {"p2p-bind-ipv4-address", "Interface for p2p network protocol (IPv4)", "0.0.0.0"}; + const command_line::arg_descriptor arg_p2p_bind_ipv6_address = {"p2p-bind-ipv6-address", "Interface for p2p network protocol (IPv6)", "::"}; +- const command_line::arg_descriptor arg_p2p_bind_port_ipv4 = { +- "p2p-bind-port-ipv4" ++ const command_line::arg_descriptor arg_p2p_bind_ipv4_port = { ++ "p2p-bind-ipv4-port" + , "Port for p2p network protocol (IPv4)" + , std::to_string(config::P2P_DEFAULT_PORT) + , {{ &cryptonote::arg_testnet_on, &cryptonote::arg_stagenet_on }} +@@ -126,8 +126,8 @@ namespace nodetool + return val; + } + }; +- const command_line::arg_descriptor arg_p2p_bind_port_ipv6 = { +- "p2p-bind-port-ipv6" ++ const command_line::arg_descriptor arg_p2p_bind_ipv6_port = { ++ "p2p-bind-ipv6-port" + , "Port for p2p network protocol (IPv6)" + , std::to_string(config::P2P_DEFAULT_PORT) + , {{ &cryptonote::arg_testnet_on, &cryptonote::arg_stagenet_on }} +diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h +index 1b51c61fffc2..a373c80a3575 100644 +--- a/src/p2p/net_node.h ++++ b/src/p2p/net_node.h +@@ -522,8 +522,8 @@ namespace nodetool + const int64_t default_limit_down = P2P_DEFAULT_LIMIT_RATE_DOWN; // kB/s + extern const command_line::arg_descriptor arg_p2p_bind_ipv4_address; + extern const command_line::arg_descriptor arg_p2p_bind_ipv6_address; +- extern const command_line::arg_descriptor arg_p2p_bind_port_ipv4; +- extern const command_line::arg_descriptor arg_p2p_bind_port_ipv6; ++ extern const command_line::arg_descriptor arg_p2p_bind_ipv4_port; ++ extern const command_line::arg_descriptor arg_p2p_bind_ipv6_port; + extern const command_line::arg_descriptor arg_p2p_use_ipv6; + extern const command_line::arg_descriptor arg_p2p_ignore_ipv4; + extern const command_line::arg_descriptor arg_p2p_external_port; +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index c8dc80cfe7f5..f50ac8ea22d5 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -101,8 +101,8 @@ namespace nodetool + { + command_line::add_arg(desc, arg_p2p_bind_ipv4_address); + command_line::add_arg(desc, arg_p2p_bind_ipv6_address); +- command_line::add_arg(desc, arg_p2p_bind_port_ipv4, false); +- command_line::add_arg(desc, arg_p2p_bind_port_ipv6, false); ++ command_line::add_arg(desc, arg_p2p_bind_ipv4_port, false); ++ command_line::add_arg(desc, arg_p2p_bind_ipv6_port, false); + command_line::add_arg(desc, arg_p2p_use_ipv6); + command_line::add_arg(desc, arg_p2p_ignore_ipv4); + command_line::add_arg(desc, arg_p2p_external_port); +@@ -414,8 +414,8 @@ namespace nodetool + public_zone.m_connect = &public_connect; + public_zone.m_bind_ipv4_address = command_line::get_arg(vm, arg_p2p_bind_ipv4_address); + public_zone.m_bind_ipv6_address = command_line::get_arg(vm, arg_p2p_bind_ipv6_address); +- public_zone.m_port_ipv4 = command_line::get_arg(vm, arg_p2p_bind_port_ipv4); +- public_zone.m_port_ipv6 = command_line::get_arg(vm, arg_p2p_bind_port_ipv6); ++ public_zone.m_port_ipv4 = command_line::get_arg(vm, arg_p2p_bind_ipv4_port); ++ public_zone.m_port_ipv6 = command_line::get_arg(vm, arg_p2p_bind_ipv6_port); + public_zone.m_can_pingback = true; + m_external_port = command_line::get_arg(vm, arg_p2p_external_port); + m_allow_local_ip = command_line::get_arg(vm, arg_p2p_allow_local_ip); +diff --git a/tests/functional_tests/functional_tests_rpc.py b/tests/functional_tests/functional_tests_rpc.py +index 8c8a8cfd0110..287c1009a618 100755 +--- a/tests/functional_tests/functional_tests_rpc.py ++++ b/tests/functional_tests/functional_tests_rpc.py +@@ -52,7 +52,7 @@ WALLET_DIRECTORY = builddir + "/functional-tests-directory" + FUNCTIONAL_TESTS_DIRECTORY = builddir + "/tests/functional_tests" + DIFFICULTY = 10 + +-monerod_base = [builddir + "/bin/monerod", "--regtest", "--fixed-difficulty", str(DIFFICULTY), "--no-igd", "--p2p-bind-port-ipv4", "monerod_p2p_port", "--rpc-bind-port", "monerod_rpc_port", "--zmq-rpc-bind-port", "monerod_zmq_port", "--zmq-pub", "monerod_zmq_pub", "--non-interactive", "--disable-dns-checkpoints", "--check-updates", "disabled", "--rpc-ssl", "disabled", "--data-dir", "monerod_data_dir", "--log-level", "1"] ++monerod_base = [builddir + "/bin/monerod", "--regtest", "--fixed-difficulty", str(DIFFICULTY), "--no-igd", "--p2p-bind-ipv4-port", "monerod_p2p_port", "--rpc-bind-port", "monerod_rpc_port", "--zmq-rpc-bind-port", "monerod_zmq_port", "--zmq-pub", "monerod_zmq_pub", "--non-interactive", "--disable-dns-checkpoints", "--check-updates", "disabled", "--rpc-ssl", "disabled", "--data-dir", "monerod_data_dir", "--log-level", "1"] + monerod_extra = [ + ["--offline"], + ["--rpc-payment-address", "44SKxxLQw929wRF6BA9paQ1EWFshNnKhXM3qz6Mo3JGDE2YG3xyzVutMStEicxbQGRfrYvAAYxH6Fe8rnD56EaNwUiqhcwR", "--rpc-payment-difficulty", str(DIFFICULTY), "--rpc-payment-credits", "5000", "--offline"], +diff --git a/tests/trezor/daemon.cpp b/tests/trezor/daemon.cpp +index 308fa6fc0876..f35dc3d8e003 100644 +--- a/tests/trezor/daemon.cpp ++++ b/tests/trezor/daemon.cpp +@@ -69,7 +69,7 @@ void mock_daemon::default_options(boost::program_options::variables_map & vm) + // By default pick non-standard ports to avoid confusion with possibly locally running daemons (mainnet/testnet) + const char *test_p2p_port = getenv("TEST_P2P_PORT"); + auto p2p_port = std::string(test_p2p_port && strlen(test_p2p_port) > 0 ? test_p2p_port : "61340"); +- tools::options::set_option(vm, nodetool::arg_p2p_bind_port_ipv4, po::variable_value(p2p_port, false)); ++ tools::options::set_option(vm, nodetool::arg_p2p_bind_ipv4_port, po::variable_value(p2p_port, false)); + + const char *test_rpc_port = getenv("TEST_RPC_PORT"); + auto rpc_port = std::string(test_rpc_port && strlen(test_rpc_port) > 0 ? test_rpc_port : "61341"); +@@ -85,7 +85,7 @@ void mock_daemon::default_options(boost::program_options::variables_map & vm) + void mock_daemon::set_ports(boost::program_options::variables_map & vm, unsigned initial_port) + { + CHECK_AND_ASSERT_THROW_MES(initial_port < 65535-2, "Invalid port number"); +- tools::options::set_option(vm, nodetool::arg_p2p_bind_port_ipv4, po::variable_value(std::to_string(initial_port), false)); ++ tools::options::set_option(vm, nodetool::arg_p2p_bind_ipv4_port, po::variable_value(std::to_string(initial_port), false)); + tools::options::set_option(vm, cryptonote::core_rpc_server::arg_rpc_bind_port, po::variable_value(std::to_string(initial_port + 1), false)); + tools::options::set_option(vm, daemon_args::arg_zmq_rpc_bind_port, po::variable_value(std::to_string(initial_port + 2), false)); + po::notify(vm); +@@ -93,7 +93,7 @@ void mock_daemon::set_ports(boost::program_options::variables_map & vm, unsigned + + void mock_daemon::load_params(boost::program_options::variables_map const & vm) + { +- m_p2p_bind_port = command_line::get_arg(vm, nodetool::arg_p2p_bind_port_ipv4); ++ m_p2p_bind_port = command_line::get_arg(vm, nodetool::arg_p2p_bind_ipv4_port); + m_rpc_bind_port = command_line::get_arg(vm, cryptonote::core_rpc_server::arg_rpc_bind_port); + m_zmq_bind_port = command_line::get_arg(vm, daemon_args::arg_zmq_rpc_bind_port); + m_network_type = command_line::get_arg(vm, cryptonote::arg_testnet_on) ? cryptonote::TESTNET : cryptonote::MAINNET; +diff --git a/tests/unit_tests/node_server.cpp b/tests/unit_tests/node_server.cpp +index 584ca3d63884..c06a4e67219d 100644 +--- a/tests/unit_tests/node_server.cpp ++++ b/tests/unit_tests/node_server.cpp +@@ -310,7 +310,7 @@ TEST(node_server, bind_same_p2p_port) + ifconfig lo0 alias 127.0.0.2 + */ + vm.find(nodetool::arg_p2p_bind_ipv4_address.name)->second = boost::program_options::variable_value(std::string("127.0.0.2"), false); +- vm.find(nodetool::arg_p2p_bind_port_ipv4.name)->second = boost::program_options::variable_value(std::string(port), false); ++ vm.find(nodetool::arg_p2p_bind_ipv4_port.name)->second = boost::program_options::variable_value(std::string(port), false); + + boost::program_options::notify(vm); + +@@ -1141,7 +1141,7 @@ TEST(node_server, race_condition) + boost::program_options::store( + boost::program_options::command_line_parser({ + "--p2p-bind-ipv4-address=127.0.0.1", +- "--p2p-bind-port-ipv4=48080", ++ "--p2p-bind-ipv4-port=48080", + "--out-peers=0", + "--data-dir", + dir.string(), +diff --git a/utils/fish/monerod.fish b/utils/fish/monerod.fish +index e1b3551eec9b..9080d47b3636 100644 +--- a/utils/fish/monerod.fish ++++ b/utils/fish/monerod.fish +@@ -56,8 +56,8 @@ complete -c monerod -l db-sync-mode -r -d "Specify sync option, using format [sa + complete -c monerod -l db-salvage -d "Try to salvage a blockchain database if it seems corrupted" + complete -c monerod -l p2p-bind-ipv4-address -r -d "Interface for p2p network protocol (IPv4). Default: 0.0.0.0" + complete -c monerod -l p2p-bind-ipv6-address -r -d "Interface for p2p network protocol (IPv6). Default: ::" +-complete -c monerod -l p2p-bind-port-ipv4 -r -d "Port for p2p network protocol (IPv4). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" +-complete -c monerod -l p2p-bind-port-ipv6 -d "Port for p2p network protocol (IPv6). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" ++complete -c monerod -l p2p-bind-ipv4-port -r -d "Port for p2p network protocol (IPv4). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" ++complete -c monerod -l p2p-bind-ipv6-port -d "Port for p2p network protocol (IPv6). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" + complete -c monerod -l p2p-use-ipv6 -d "Enable IPv6 for p2p" + complete -c monerod -l p2p-ignore-ipv4 -d "Ignore unsuccessful IPv4 bind for p2p" + complete -c monerod -l p2p-external-port -r -d "External port for p2p network protocol (if port forwarding used with NAT). Default: 0" diff --git a/net-p2p/monero/files/monero-9999-net-define-IPv4-object-explicitly.patch b/net-p2p/monero/files/monero-9999-net-define-IPv4-object-explicitly.patch new file mode 100644 index 00000000..6246b3fd --- /dev/null +++ b/net-p2p/monero/files/monero-9999-net-define-IPv4-object-explicitly.patch @@ -0,0 +1,2377 @@ +From 644e06a9091825b86f1df178fa91463b58686030 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 4 Apr 2024 22:33:16 +0100 +Subject: [PATCH] net: define IPv4 object explicitly + +Modify all IPv4 variables, function arguments name and daemon arguments +to IPv4 specific naming to raise consistency with IPv6. This change is +done in order to make source code more legible before addressing #8818. + +* --p2p-bind-ip is replaced with --p2p-bind-ipv4-address +* --p2p-bind-port is replaced with --p2p-bind-port-ipv4 +* --rpc-bind-ip is replaced with --rpc-bind-ipv4-address +* --rpc-restricted-bind-ip is replaced with --rpc-restricted-bind-ipv4-address + +Bug: https://github.com/monero-project/monero/issues/8818 +--- + Dockerfile | 2 +- + README.md | 6 +-- + .../epee/include/net/abstract_tcp_server2.h | 12 +++--- + .../epee/include/net/abstract_tcp_server2.inl | 38 +++++++++--------- + .../epee/include/net/http_server_impl_base.h | 14 +++---- + src/daemon/main.cpp | 6 +-- + src/daemon/rpc.h | 2 +- + src/p2p/net_node.cpp | 6 +-- + src/p2p/net_node.h | 20 +++++----- + src/p2p/net_node.inl | 40 +++++++++---------- + src/rpc/core_rpc_server.cpp | 12 +++--- + src/rpc/rpc_args.cpp | 40 +++++++++---------- + src/rpc/rpc_args.h | 8 ++-- + src/wallet/wallet_rpc_server.cpp | 2 +- + .../functional_tests/functional_tests_rpc.py | 2 +- + tests/trezor/daemon.cpp | 8 ++-- + tests/unit_tests/node_server.cpp | 8 ++-- + translations/monero.ts | 6 +-- + translations/monero_ar.ts | 6 +-- + translations/monero_bg.ts | 6 +-- + translations/monero_bn.ts | 6 +-- + translations/monero_cat.ts | 6 +-- + translations/monero_cs.ts | 6 +-- + translations/monero_da.ts | 6 +-- + translations/monero_de.ts | 6 +-- + translations/monero_el.ts | 6 +-- + translations/monero_eo.ts | 6 +-- + translations/monero_es.ts | 6 +-- + translations/monero_fa.ts | 6 +-- + translations/monero_fi.ts | 6 +-- + translations/monero_fr.ts | 8 ++-- + translations/monero_ga.ts | 6 +-- + translations/monero_he.ts | 6 +-- + translations/monero_hi.ts | 6 +-- + translations/monero_hr.ts | 6 +-- + translations/monero_hu.ts | 6 +-- + translations/monero_id.ts | 6 +-- + translations/monero_is.ts | 6 +-- + translations/monero_it.ts | 8 ++-- + translations/monero_ja.ts | 8 ++-- + translations/monero_kmr.ts | 6 +-- + translations/monero_ko.ts | 6 +-- + translations/monero_lt.ts | 6 +-- + translations/monero_nb_NO.ts | 6 +-- + translations/monero_ne.ts | 6 +-- + translations/monero_nl.ts | 6 +-- + translations/monero_pl.ts | 6 +-- + translations/monero_prt.ts | 6 +-- + translations/monero_pt-br.ts | 6 +-- + translations/monero_pt-pt.ts | 6 +-- + translations/monero_ro.ts | 6 +-- + translations/monero_ru.ts | 6 +-- + translations/monero_sk.ts | 6 +-- + translations/monero_sl.ts | 6 +-- + translations/monero_sr.ts | 6 +-- + translations/monero_sv.ts | 8 ++-- + translations/monero_tr.ts | 6 +-- + translations/monero_uk.ts | 6 +-- + translations/monero_ur.ts | 6 +-- + translations/monero_zh-cn.ts | 6 +-- + translations/monero_zh-tw.ts | 6 +-- + translations/monero_zu.ts | 6 +-- + translations/monero_zu.ts.ts | 6 +-- + utils/fish/monero-wallet-rpc.fish | 6 +-- + utils/fish/monerod.fish | 10 ++--- + 65 files changed, 263 insertions(+), 263 deletions(-) + +diff --git a/Dockerfile b/Dockerfile +index 1c373cbc9aaf..6058eabadc46 100644 +--- a/Dockerfile ++++ b/Dockerfile +@@ -62,5 +62,5 @@ EXPOSE 18081 + USER monero + + ENTRYPOINT ["monerod"] +-CMD ["--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=18080", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--confirm-external-bind"] ++CMD ["--p2p-bind-ipv4-address=0.0.0.0", "--p2p-bind-port-ipv4=18080", "--rpc-bind-ipv4-address=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--confirm-external-bind"] + +diff --git a/README.md b/README.md +index 5bde48dd9d31..7369e7c443ef 100644 +--- a/README.md ++++ b/README.md +@@ -727,7 +727,7 @@ See [README.i18n.md](docs/README.i18n.md). + While Monero isn't made to integrate with Tor, it can be used wrapped with torsocks, by + setting the following configuration parameters and environment variables: + +-* `--p2p-bind-ip 127.0.0.1` on the command line or `p2p-bind-ip=127.0.0.1` in ++* `--p2p-bind-ipv4-address 127.0.0.1` on the command line or `p2p-bind-ipv4-address=127.0.0.1` in + monerod.conf to disable listening for connections on external interfaces. + * `--no-igd` on the command line or `no-igd=1` in monerod.conf to disable IGD + (UPnP port forwarding negotiation), which is pointless with Tor. +@@ -749,7 +749,7 @@ setting the following configuration parameters and environment variables: + Example command line to start monerod through Tor: + + ```bash +-DNS_PUBLIC=tcp torsocks monerod --p2p-bind-ip 127.0.0.1 --no-igd ++DNS_PUBLIC=tcp torsocks monerod --p2p-bind-ipv4-address 127.0.0.1 --no-igd + ``` + + A helper script is in contrib/tor/monero-over-tor.sh. It assumes Tor is installed +@@ -763,7 +763,7 @@ allow inbound connections. Full example: + + ```bash + sudo iptables -I OUTPUT 2 -p tcp -d 127.0.0.1 -m tcp --dport 18081 -j ACCEPT +-DNS_PUBLIC=tcp torsocks ./monerod --p2p-bind-ip 127.0.0.1 --no-igd --rpc-bind-ip 127.0.0.1 \ ++DNS_PUBLIC=tcp torsocks ./monerod --p2p-bind-ipv4-address 127.0.0.1 --no-igd --rpc-bind-ipv4-address 127.0.0.1 \ + --data-dir /home/amnesia/Persistent/your/directory/to/the/blockchain + ``` + +diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h +index bc0da66e2993..ece9c1d1337f 100644 +--- a/contrib/epee/include/net/abstract_tcp_server2.h ++++ b/contrib/epee/include/net/abstract_tcp_server2.h +@@ -342,10 +342,10 @@ namespace net_utils + std::map server_type_map; + void create_server_type_map(); + +- bool init_server(uint32_t port, const std::string& address = "0.0.0.0", ++ bool init_server(uint32_t port_ipv4, const std::string& address_ipv4 = "0.0.0.0", + uint32_t port_ipv6 = 0, const std::string& address_ipv6 = "::", bool use_ipv6 = false, bool require_ipv4 = true, + ssl_options_t ssl_options = ssl_support_t::e_ssl_support_autodetect); +- bool init_server(const std::string port, const std::string& address = "0.0.0.0", ++ bool init_server(const std::string port_ipv4, const std::string& address_ipv4 = "0.0.0.0", + const std::string port_ipv6 = "", const std::string address_ipv6 = "::", bool use_ipv6 = false, bool require_ipv4 = true, + ssl_options_t ssl_options = ssl_support_t::e_ssl_support_autodetect); + +@@ -399,7 +399,7 @@ namespace net_utils + return {m_state}; + } + +- int get_binded_port(){return m_port;} ++ int get_binded_port_ipv4(){return m_port_ipv4;} + int get_binded_port_ipv6(){return m_port_ipv6;} + + long get_connections_count() const +@@ -498,9 +498,9 @@ namespace net_utils + epee::net_utils::network_address default_remote; + + std::atomic m_stop_signal_sent; +- uint32_t m_port; ++ uint32_t m_port_ipv4; + uint32_t m_port_ipv6; +- std::string m_address; ++ std::string m_address_ipv4; + std::string m_address_ipv6; + bool m_use_ipv6; + bool m_require_ipv4; +@@ -514,7 +514,7 @@ namespace net_utils + t_connection_type m_connection_type; + + /// The next connection to be accepted +- connection_ptr new_connection_; ++ connection_ptr new_connection_ipv4; + connection_ptr new_connection_ipv6; + + +diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl +index d88f18194213..a9409baf5ae1 100644 +--- a/contrib/epee/include/net/abstract_tcp_server2.inl ++++ b/contrib/epee/include/net/abstract_tcp_server2.inl +@@ -1133,11 +1133,11 @@ namespace net_utils + acceptor_(io_service_), + acceptor_ipv6(io_service_), + default_remote(), +- m_stop_signal_sent(false), m_port(0), ++ m_stop_signal_sent(false), m_port_ipv4(0), + m_threads_count(0), + m_thread_index(0), + m_connection_type( connection_type ), +- new_connection_(), ++ new_connection_ipv4(), + new_connection_ipv6() + { + create_server_type_map(); +@@ -1151,11 +1151,11 @@ namespace net_utils + acceptor_(io_service_), + acceptor_ipv6(io_service_), + default_remote(), +- m_stop_signal_sent(false), m_port(0), ++ m_stop_signal_sent(false), m_port_ipv4(0), + m_threads_count(0), + m_thread_index(0), + m_connection_type(connection_type), +- new_connection_(), ++ new_connection_ipv4(), + new_connection_ipv6() + { + create_server_type_map(); +@@ -1178,15 +1178,15 @@ namespace net_utils + } + //--------------------------------------------------------------------------------- + template +- bool boosted_tcp_server::init_server(uint32_t port, const std::string& address, ++ bool boosted_tcp_server::init_server(uint32_t port_ipv4, const std::string& address_ipv4, + uint32_t port_ipv6, const std::string& address_ipv6, bool use_ipv6, bool require_ipv4, + ssl_options_t ssl_options) + { + TRY_ENTRY(); + m_stop_signal_sent = false; +- m_port = port; ++ m_port_ipv4 = port_ipv4; + m_port_ipv6 = port_ipv6; +- m_address = address; ++ m_address_ipv4 = address_ipv4; + m_address_ipv6 = address_ipv6; + m_use_ipv6 = use_ipv6; + m_require_ipv4 = require_ipv4; +@@ -1199,7 +1199,7 @@ namespace net_utils + try + { + boost::asio::ip::tcp::resolver resolver(io_service_); +- boost::asio::ip::tcp::resolver::query query(address, boost::lexical_cast(port), boost::asio::ip::tcp::resolver::query::canonical_name); ++ boost::asio::ip::tcp::resolver::query query(address_ipv4, boost::lexical_cast(port_ipv4), boost::asio::ip::tcp::resolver::query::canonical_name); + boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); + acceptor_.open(endpoint.protocol()); + #if !defined(_WIN32) +@@ -1208,10 +1208,10 @@ namespace net_utils + acceptor_.bind(endpoint); + acceptor_.listen(); + boost::asio::ip::tcp::endpoint binded_endpoint = acceptor_.local_endpoint(); +- m_port = binded_endpoint.port(); ++ m_port_ipv4 = binded_endpoint.port(); + MDEBUG("start accept (IPv4)"); +- new_connection_.reset(new connection(io_service_, m_state, m_connection_type, m_state->ssl_options().support)); +- acceptor_.async_accept(new_connection_->socket(), ++ new_connection_ipv4.reset(new connection(io_service_, m_state, m_connection_type, m_state->ssl_options().support)); ++ acceptor_.async_accept(new_connection_ipv4->socket(), + boost::bind(&boosted_tcp_server::handle_accept_ipv4, this, + boost::asio::placeholders::error)); + } +@@ -1233,7 +1233,7 @@ namespace net_utils + { + try + { +- if (port_ipv6 == 0) port_ipv6 = port; // default arg means bind to same port as ipv4 ++ if (port_ipv6 == 0) port_ipv6 = port_ipv4; // default arg means bind to same port as ipv4 + boost::asio::ip::tcp::resolver resolver(io_service_); + boost::asio::ip::tcp::resolver::query query(address_ipv6, boost::lexical_cast(port_ipv6), boost::asio::ip::tcp::resolver::query::canonical_name); + boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); +@@ -1282,15 +1282,15 @@ namespace net_utils + } + //----------------------------------------------------------------------------- + template +- bool boosted_tcp_server::init_server(const std::string port, const std::string& address, ++ bool boosted_tcp_server::init_server(const std::string port_ipv4, const std::string& address_ipv4, + const std::string port_ipv6, const std::string address_ipv6, bool use_ipv6, bool require_ipv4, + ssl_options_t ssl_options) + { +- uint32_t p = 0; ++ uint32_t p_ipv4 = 0; + uint32_t p_ipv6 = 0; + +- if (port.size() && !string_tools::get_xtype_from_string(p, port)) { +- MERROR("Failed to convert port no = " << port); ++ if (port_ipv4.size() && !string_tools::get_xtype_from_string(p_ipv4, port_ipv4)) { ++ MERROR("Failed to convert port no = " << port_ipv4); + return false; + } + +@@ -1298,7 +1298,7 @@ namespace net_utils + MERROR("Failed to convert port no = " << port_ipv6); + return false; + } +- return this->init_server(p, address, p_ipv6, address_ipv6, use_ipv6, require_ipv4, std::move(ssl_options)); ++ return this->init_server(p_ipv4, address_ipv4, p_ipv6, address_ipv6, use_ipv6, require_ipv4, std::move(ssl_options)); + } + //--------------------------------------------------------------------------------- + template +@@ -1389,7 +1389,7 @@ namespace net_utils + { + //some problems with the listening socket ?.. + _dbg1("Net service stopped without stop request, restarting..."); +- if(!this->init_server(m_port, m_address, m_port_ipv6, m_address_ipv6, m_use_ipv6, m_require_ipv4)) ++ if(!this->init_server(m_port_ipv4, m_address_ipv4, m_port_ipv6, m_address_ipv6, m_use_ipv6, m_require_ipv4)) + { + _dbg1("Reiniting service failed, exit."); + return false; +@@ -1472,7 +1472,7 @@ namespace net_utils + MDEBUG("handle_accept"); + + boost::asio::ip::tcp::acceptor* current_acceptor = &acceptor_; +- connection_ptr* current_new_connection = &new_connection_; ++ connection_ptr* current_new_connection = &new_connection_ipv4; + auto accept_function_pointer = &boosted_tcp_server::handle_accept_ipv4; + if (ipv6) + { +diff --git a/contrib/epee/include/net/http_server_impl_base.h b/contrib/epee/include/net/http_server_impl_base.h +index d88b53c9427c..94d519716918 100644 +--- a/contrib/epee/include/net/http_server_impl_base.h ++++ b/contrib/epee/include/net/http_server_impl_base.h +@@ -56,8 +56,8 @@ namespace epee + : m_net_server(external_io_service) + {} + +- bool init(std::function rng, const std::string& bind_port = "0", const std::string& bind_ip = "0.0.0.0", +- const std::string& bind_ipv6_address = "::", bool use_ipv6 = false, bool require_ipv4 = true, ++ bool init(std::function rng, const std::string& bind_port = "0", const std::string& bind_address_ipv4 = "0.0.0.0", ++ const std::string& bind_address_ipv6 = "::", bool use_ipv6 = false, bool require_ipv4 = true, + std::vector access_control_origins = std::vector(), + boost::optional user = boost::none, + net_utils::ssl_options_t ssl_options = net_utils::ssl_support_t::e_ssl_support_autodetect) +@@ -76,12 +76,12 @@ namespace epee + + m_net_server.get_config_object().m_user = std::move(user); + +- MGINFO("Binding on " << bind_ip << " (IPv4):" << bind_port); ++ MGINFO("Binding on " << bind_address_ipv4 << " (IPv4):" << bind_port); + if (use_ipv6) + { +- MGINFO("Binding on " << bind_ipv6_address << " (IPv6):" << bind_port); ++ MGINFO("Binding on " << bind_address_ipv6 << " (IPv6):" << bind_port); + } +- bool res = m_net_server.init_server(bind_port, bind_ip, bind_port, bind_ipv6_address, use_ipv6, require_ipv4, std::move(ssl_options)); ++ bool res = m_net_server.init_server(bind_port, bind_address_ipv4, bind_port, bind_address_ipv6, use_ipv6, require_ipv4, std::move(ssl_options)); + if(!res) + { + LOG_ERROR("Failed to bind server"); +@@ -120,9 +120,9 @@ namespace epee + return true; + } + +- int get_binded_port() ++ int get_binded_port_ipv4() + { +- return m_net_server.get_binded_port(); ++ return m_net_server.get_binded_port_ipv4(); + } + + long get_connections_count() const +diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp +index e2ff27daa1ca..76759e8b7b87 100644 +--- a/src/daemon/main.cpp ++++ b/src/daemon/main.cpp +@@ -66,12 +66,12 @@ uint16_t parse_public_rpc_port(const po::variables_map &vm) + } + + std::string rpc_port_str; +- std::string rpc_bind_address = command_line::get_arg(vm, cryptonote::rpc_args::descriptors().rpc_bind_ip); ++ std::string rpc_bind_address = command_line::get_arg(vm, cryptonote::rpc_args::descriptors().rpc_bind_ipv4_address); + const auto &restricted_rpc_port = cryptonote::core_rpc_server::arg_rpc_restricted_bind_port; + if (!command_line::is_arg_defaulted(vm, restricted_rpc_port)) + { + rpc_port_str = command_line::get_arg(vm, restricted_rpc_port); +- rpc_bind_address = command_line::get_arg(vm, cryptonote::rpc_args::descriptors().rpc_restricted_bind_ip); ++ rpc_bind_address = command_line::get_arg(vm, cryptonote::rpc_args::descriptors().rpc_restricted_bind_ipv4_address); + } + else if (command_line::get_arg(vm, cryptonote::core_rpc_server::arg_restricted_rpc)) + { +@@ -308,7 +308,7 @@ int main(int argc, char const * argv[]) + if (command.size()) + { + const cryptonote::rpc_args::descriptors arg{}; +- auto rpc_ip_str = command_line::get_arg(vm, arg.rpc_bind_ip); ++ auto rpc_ip_str = command_line::get_arg(vm, arg.rpc_bind_ipv4_address); + auto rpc_port_str = command_line::get_arg(vm, cryptonote::core_rpc_server::arg_rpc_bind_port); + + uint32_t rpc_ip; +diff --git a/src/daemon/rpc.h b/src/daemon/rpc.h +index f7bdb921eae4..3f111968d919 100644 +--- a/src/daemon/rpc.h ++++ b/src/daemon/rpc.h +@@ -66,7 +66,7 @@ public: + { + throw std::runtime_error("Failed to initialize " + m_description + " RPC server."); + } +- MGINFO(m_description << " RPC server initialized OK on port: " << m_server.get_binded_port()); ++ MGINFO(m_description << " RPC server initialized OK on port: " << m_server.get_binded_port_ipv4()); + } + + void run() +diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp +index 13ff06c8b188..635ab41ea6b7 100644 +--- a/src/p2p/net_node.cpp ++++ b/src/p2p/net_node.cpp +@@ -111,10 +111,10 @@ namespace + + namespace nodetool + { +- const command_line::arg_descriptor arg_p2p_bind_ip = {"p2p-bind-ip", "Interface for p2p network protocol (IPv4)", "0.0.0.0"}; ++ const command_line::arg_descriptor arg_p2p_bind_ipv4_address = {"p2p-bind-ipv4-address", "Interface for p2p network protocol (IPv4)", "0.0.0.0"}; + const command_line::arg_descriptor arg_p2p_bind_ipv6_address = {"p2p-bind-ipv6-address", "Interface for p2p network protocol (IPv6)", "::"}; +- const command_line::arg_descriptor arg_p2p_bind_port = { +- "p2p-bind-port" ++ const command_line::arg_descriptor arg_p2p_bind_port_ipv4 = { ++ "p2p-bind-port-ipv4" + , "Port for p2p network protocol (IPv4)" + , std::to_string(config::P2P_DEFAULT_PORT) + , {{ &cryptonote::arg_testnet_on, &cryptonote::arg_stagenet_on }} +diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h +index 459a6a3966e9..1b51c61fffc2 100644 +--- a/src/p2p/net_node.h ++++ b/src/p2p/net_node.h +@@ -161,9 +161,9 @@ namespace nodetool + : m_connect(nullptr), + m_net_server(epee::net_utils::e_connection_type_P2P), + m_seed_nodes(), +- m_bind_ip(), ++ m_bind_ipv4_address(), + m_bind_ipv6_address(), +- m_port(), ++ m_port_ipv4(), + m_port_ipv6(), + m_notifier(), + m_our_address(), +@@ -183,9 +183,9 @@ namespace nodetool + : m_connect(nullptr), + m_net_server(public_service, epee::net_utils::e_connection_type_P2P), + m_seed_nodes(), +- m_bind_ip(), ++ m_bind_ipv4_address(), + m_bind_ipv6_address(), +- m_port(), ++ m_port_ipv4(), + m_port_ipv6(), + m_notifier(), + m_our_address(), +@@ -204,9 +204,9 @@ namespace nodetool + connect_func* m_connect; + net_server m_net_server; + std::vector m_seed_nodes; +- std::string m_bind_ip; ++ std::string m_bind_ipv4_address; + std::string m_bind_ipv6_address; +- std::string m_port; ++ std::string m_port_ipv4; + std::string m_port_ipv6; + cryptonote::levin::notify m_notifier; + epee::net_utils::network_address m_our_address; // in anonymity networks +@@ -266,7 +266,7 @@ namespace nodetool + bool init(const boost::program_options::variables_map& vm, const std::string& proxy = {}, bool proxy_dns_leaks_allowed = {}); + bool deinit(); + bool send_stop_signal(); +- uint32_t get_this_peer_port(){return m_listening_port;} ++ uint32_t get_this_peer_port(){return m_listening_port_ipv4;} + t_payload_net_handler& get_payload_object(); + + // debug functions +@@ -448,7 +448,7 @@ namespace nodetool + + bool m_have_address; + bool m_first_connection_maker_call; +- uint32_t m_listening_port; ++ uint32_t m_listening_port_ipv4; + uint32_t m_listening_port_ipv6; + uint32_t m_external_port; + uint16_t m_rpc_port; +@@ -520,9 +520,9 @@ namespace nodetool + + const int64_t default_limit_up = P2P_DEFAULT_LIMIT_RATE_UP; // kB/s + const int64_t default_limit_down = P2P_DEFAULT_LIMIT_RATE_DOWN; // kB/s +- extern const command_line::arg_descriptor arg_p2p_bind_ip; ++ extern const command_line::arg_descriptor arg_p2p_bind_ipv4_address; + extern const command_line::arg_descriptor arg_p2p_bind_ipv6_address; +- extern const command_line::arg_descriptor arg_p2p_bind_port; ++ extern const command_line::arg_descriptor arg_p2p_bind_port_ipv4; + extern const command_line::arg_descriptor arg_p2p_bind_port_ipv6; + extern const command_line::arg_descriptor arg_p2p_use_ipv6; + extern const command_line::arg_descriptor arg_p2p_ignore_ipv4; +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 815c1b354ef2..c8dc80cfe7f5 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -99,9 +99,9 @@ namespace nodetool + template + void node_server::init_options(boost::program_options::options_description& desc) + { +- command_line::add_arg(desc, arg_p2p_bind_ip); ++ command_line::add_arg(desc, arg_p2p_bind_ipv4_address); + command_line::add_arg(desc, arg_p2p_bind_ipv6_address); +- command_line::add_arg(desc, arg_p2p_bind_port, false); ++ command_line::add_arg(desc, arg_p2p_bind_port_ipv4, false); + command_line::add_arg(desc, arg_p2p_bind_port_ipv6, false); + command_line::add_arg(desc, arg_p2p_use_ipv6); + command_line::add_arg(desc, arg_p2p_ignore_ipv4); +@@ -412,9 +412,9 @@ namespace nodetool + + network_zone& public_zone = m_network_zones[epee::net_utils::zone::public_]; + public_zone.m_connect = &public_connect; +- public_zone.m_bind_ip = command_line::get_arg(vm, arg_p2p_bind_ip); ++ public_zone.m_bind_ipv4_address = command_line::get_arg(vm, arg_p2p_bind_ipv4_address); + public_zone.m_bind_ipv6_address = command_line::get_arg(vm, arg_p2p_bind_ipv6_address); +- public_zone.m_port = command_line::get_arg(vm, arg_p2p_bind_port); ++ public_zone.m_port_ipv4 = command_line::get_arg(vm, arg_p2p_bind_port_ipv4); + public_zone.m_port_ipv6 = command_line::get_arg(vm, arg_p2p_bind_port_ipv6); + public_zone.m_can_pingback = true; + m_external_port = command_line::get_arg(vm, arg_p2p_external_port); +@@ -627,7 +627,7 @@ namespace nodetool + { + network_zone& zone = add_zone(inbound.our_address.get_zone()); + +- if (!zone.m_bind_ip.empty()) ++ if (!zone.m_bind_ipv4_address.empty()) + { + MERROR("Listed --" << arg_anonymous_inbound.name << " twice with " << epee::net_utils::zone_to_string(inbound.our_address.get_zone()) << " network"); + return false; +@@ -639,8 +639,8 @@ namespace nodetool + return false; + } + +- zone.m_bind_ip = std::move(inbound.local_ip); +- zone.m_port = std::move(inbound.local_port); ++ zone.m_bind_ipv4_address = std::move(inbound.local_ip); ++ zone.m_port_ipv4 = std::move(inbound.local_port); + zone.m_net_server.set_default_remote(std::move(inbound.default_remote)); + zone.m_our_address = std::move(inbound.our_address); + +@@ -927,10 +927,10 @@ namespace nodetool + m_config_folder = command_line::get_arg(vm, cryptonote::arg_data_dir); + network_zone& public_zone = m_network_zones.at(epee::net_utils::zone::public_); + +- if ((m_nettype == cryptonote::MAINNET && public_zone.m_port != std::to_string(::config::P2P_DEFAULT_PORT)) +- || (m_nettype == cryptonote::TESTNET && public_zone.m_port != std::to_string(::config::testnet::P2P_DEFAULT_PORT)) +- || (m_nettype == cryptonote::STAGENET && public_zone.m_port != std::to_string(::config::stagenet::P2P_DEFAULT_PORT))) { +- m_config_folder = m_config_folder + "/" + public_zone.m_port; ++ if ((m_nettype == cryptonote::MAINNET && public_zone.m_port_ipv4 != std::to_string(::config::P2P_DEFAULT_PORT)) ++ || (m_nettype == cryptonote::TESTNET && public_zone.m_port_ipv4 != std::to_string(::config::testnet::P2P_DEFAULT_PORT)) ++ || (m_nettype == cryptonote::STAGENET && public_zone.m_port_ipv4 != std::to_string(::config::stagenet::P2P_DEFAULT_PORT))) { ++ m_config_folder = m_config_folder + "/" + public_zone.m_port_ipv4; + } + + res = init_config(); +@@ -963,25 +963,25 @@ namespace nodetool + zone.second.m_net_server.get_config_object().set_handler(this); + zone.second.m_net_server.get_config_object().m_invoke_timeout = P2P_DEFAULT_INVOKE_TIMEOUT; + +- if (!zone.second.m_bind_ip.empty()) ++ if (!zone.second.m_bind_ipv4_address.empty()) + { + std::string ipv6_addr = ""; + std::string ipv6_port = ""; + zone.second.m_net_server.set_connection_filter(this); +- MINFO("Binding (IPv4) on " << zone.second.m_bind_ip << ":" << zone.second.m_port); ++ MINFO("Binding (IPv4) on " << zone.second.m_bind_ipv4_address << ":" << zone.second.m_port_ipv4); + if (!zone.second.m_bind_ipv6_address.empty() && m_use_ipv6) + { + ipv6_addr = zone.second.m_bind_ipv6_address; + ipv6_port = zone.second.m_port_ipv6; + MINFO("Binding (IPv6) on " << zone.second.m_bind_ipv6_address << ":" << zone.second.m_port_ipv6); + } +- res = zone.second.m_net_server.init_server(zone.second.m_port, zone.second.m_bind_ip, ipv6_port, ipv6_addr, m_use_ipv6, m_require_ipv4, epee::net_utils::ssl_support_t::e_ssl_support_disabled); ++ res = zone.second.m_net_server.init_server(zone.second.m_port_ipv4, zone.second.m_bind_ipv4_address, ipv6_port, ipv6_addr, m_use_ipv6, m_require_ipv4, epee::net_utils::ssl_support_t::e_ssl_support_disabled); + CHECK_AND_ASSERT_MES(res, false, "Failed to bind server"); + } + } + +- m_listening_port = public_zone.m_net_server.get_binded_port(); +- MLOG_GREEN(el::Level::Info, "Net service bound (IPv4) to " << public_zone.m_bind_ip << ":" << m_listening_port); ++ m_listening_port_ipv4 = public_zone.m_net_server.get_binded_port_ipv4(); ++ MLOG_GREEN(el::Level::Info, "Net service bound (IPv4) to " << public_zone.m_bind_ipv4_address << ":" << m_listening_port_ipv4); + if (m_use_ipv6) + { + m_listening_port_ipv6 = public_zone.m_net_server.get_binded_port_ipv6(); +@@ -993,7 +993,7 @@ namespace nodetool + // add UPnP port mapping + if(m_igd == igd) + { +- add_upnp_port_mapping_v4(m_listening_port); ++ add_upnp_port_mapping_v4(m_listening_port_ipv4); + if (m_use_ipv6) + { + add_upnp_port_mapping_v6(m_listening_port_ipv6); +@@ -1083,7 +1083,7 @@ namespace nodetool + zone.second.m_net_server.deinit_server(); + // remove UPnP port mapping + if(m_igd == igd) +- delete_upnp_port_mapping(m_listening_port); ++ delete_upnp_port_mapping(m_listening_port_ipv4); + } + return store_config(); + } +@@ -2092,7 +2092,7 @@ namespace nodetool + if (m_igd == delayed_igd) + { + MWARNING("No incoming connections, trying to setup IGD"); +- add_upnp_port_mapping(m_listening_port); ++ add_upnp_port_mapping(m_listening_port_ipv4); + m_igd = igd; + } + else +@@ -2200,7 +2200,7 @@ namespace nodetool + { + node_data.peer_id = zone.m_config.m_peer_id; + if(!m_hide_my_port && zone.m_can_pingback) +- node_data.my_port = m_external_port ? m_external_port : m_listening_port; ++ node_data.my_port = m_external_port ? m_external_port : m_listening_port_ipv4; + else + node_data.my_port = 0; + node_data.rpc_port = zone.m_can_pingback ? m_rpc_port : 0; +diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp +index 9a0b02f704fe..0ce1346cc49d 100644 +--- a/src/rpc/core_rpc_server.cpp ++++ b/src/rpc/core_rpc_server.cpp +@@ -277,7 +277,7 @@ namespace cryptonote + if (!rpc_config) + return false; + +- std::string bind_ip_str = rpc_config->bind_ip; ++ std::string bind_ipv4_str = rpc_config->bind_ipv4_address; + std::string bind_ipv6_str = rpc_config->bind_ipv6_address; + if (restricted) + { +@@ -285,7 +285,7 @@ namespace cryptonote + const bool has_restricted_rpc_port_arg = !command_line::is_arg_defaulted(vm, restricted_rpc_port_arg); + if (has_restricted_rpc_port_arg && port == command_line::get_arg(vm, restricted_rpc_port_arg)) + { +- bind_ip_str = rpc_config->restricted_bind_ip; ++ bind_ipv4_str = rpc_config->restricted_bind_ipv4_address; + bind_ipv6_str = rpc_config->restricted_bind_ipv6_address; + } + } +@@ -325,9 +325,9 @@ namespace cryptonote + + if (!m_rpc_payment) + { +- uint32_t bind_ip; +- bool ok = epee::string_tools::get_ip_int32_from_string(bind_ip, bind_ip_str); +- if (ok & !epee::net_utils::is_ip_loopback(bind_ip)) ++ uint32_t bind_ipv4; ++ bool ok = epee::string_tools::get_ip_int32_from_string(bind_ipv4, bind_ipv4_str); ++ if (ok & !epee::net_utils::is_ip_loopback(bind_ipv4)) + MWARNING("The RPC server is accessible from the outside, but no RPC payment was setup. RPC access will be free for all."); + } + +@@ -398,7 +398,7 @@ namespace cryptonote + + auto rng = [](size_t len, uint8_t *ptr){ return crypto::rand(len, ptr); }; + const bool inited = epee::http_server_impl_base::init( +- rng, std::move(port), std::move(bind_ip_str), ++ rng, std::move(port), std::move(bind_ipv4_str), + std::move(bind_ipv6_str), std::move(rpc_config->use_ipv6), std::move(rpc_config->require_ipv4), + std::move(rpc_config->access_control_origins), std::move(http_login), std::move(rpc_config->ssl_options) + ); +diff --git a/src/rpc/rpc_args.cpp b/src/rpc/rpc_args.cpp +index e6233fa984d7..3e4503b20678 100644 +--- a/src/rpc/rpc_args.cpp ++++ b/src/rpc/rpc_args.cpp +@@ -89,14 +89,14 @@ namespace cryptonote + } // anonymous + + rpc_args::descriptors::descriptors() +- : rpc_bind_ip({"rpc-bind-ip", rpc_args::tr("Specify IP to bind RPC server"), "127.0.0.1"}) ++ : rpc_bind_ipv4_address({"rpc-bind-ipv4-address", rpc_args::tr("Specify IPv4 address to bind RPC server"), "127.0.0.1"}) + , rpc_bind_ipv6_address({"rpc-bind-ipv6-address", rpc_args::tr("Specify IPv6 address to bind RPC server"), "::1"}) +- , rpc_restricted_bind_ip({"rpc-restricted-bind-ip", rpc_args::tr("Specify IP to bind restricted RPC server"), "127.0.0.1"}) ++ , rpc_restricted_bind_ipv4_address({"rpc-restricted-bind-ipv4-address", rpc_args::tr("Specify IPv4 address to bind restricted RPC server"), "127.0.0.1"}) + , rpc_restricted_bind_ipv6_address({"rpc-restricted-bind-ipv6-address", rpc_args::tr("Specify IPv6 address to bind restricted RPC server"), "::1"}) + , rpc_use_ipv6({"rpc-use-ipv6", rpc_args::tr("Allow IPv6 for RPC"), false}) + , rpc_ignore_ipv4({"rpc-ignore-ipv4", rpc_args::tr("Ignore unsuccessful IPv4 bind for RPC"), false}) + , rpc_login({"rpc-login", rpc_args::tr("Specify username[:password] required for RPC server"), "", true}) +- , confirm_external_bind({"confirm-external-bind", rpc_args::tr("Confirm rpc-bind-ip value is NOT a loopback (local) IP")}) ++ , confirm_external_bind({"confirm-external-bind", rpc_args::tr("Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP")}) + , rpc_access_control_origins({"rpc-access-control-origins", rpc_args::tr("Specify a comma separated list of origins to allow cross origin resource sharing"), ""}) + , rpc_ssl({"rpc-ssl", rpc_args::tr("Enable SSL on RPC connections: enabled|disabled|autodetect"), "autodetect"}) + , rpc_ssl_private_key({"rpc-ssl-private-key", rpc_args::tr("Path to a PEM format private key"), ""}) +@@ -113,9 +113,9 @@ namespace cryptonote + void rpc_args::init_options(boost::program_options::options_description& desc, const bool any_cert_option) + { + const descriptors arg{}; +- command_line::add_arg(desc, arg.rpc_bind_ip); ++ command_line::add_arg(desc, arg.rpc_bind_ipv4_address); + command_line::add_arg(desc, arg.rpc_bind_ipv6_address); +- command_line::add_arg(desc, arg.rpc_restricted_bind_ip); ++ command_line::add_arg(desc, arg.rpc_restricted_bind_ipv4_address); + command_line::add_arg(desc, arg.rpc_restricted_bind_ipv6_address); + command_line::add_arg(desc, arg.rpc_use_ipv6); + command_line::add_arg(desc, arg.rpc_ignore_ipv4); +@@ -138,28 +138,28 @@ namespace cryptonote + const descriptors arg{}; + rpc_args config{}; + +- config.bind_ip = command_line::get_arg(vm, arg.rpc_bind_ip); ++ config.bind_ipv4_address = command_line::get_arg(vm, arg.rpc_bind_ipv4_address); + config.bind_ipv6_address = command_line::get_arg(vm, arg.rpc_bind_ipv6_address); +- config.restricted_bind_ip = command_line::get_arg(vm, arg.rpc_restricted_bind_ip); ++ config.restricted_bind_ipv4_address = command_line::get_arg(vm, arg.rpc_restricted_bind_ipv4_address); + config.restricted_bind_ipv6_address = command_line::get_arg(vm, arg.rpc_restricted_bind_ipv6_address); + config.use_ipv6 = command_line::get_arg(vm, arg.rpc_use_ipv6); + config.require_ipv4 = !command_line::get_arg(vm, arg.rpc_ignore_ipv4); + config.disable_rpc_ban = command_line::get_arg(vm, arg.disable_rpc_ban); +- if (!config.bind_ip.empty()) ++ if (!config.bind_ipv4_address.empty()) + { +- // always parse IP here for error consistency ++ // always parse IPv4 here for error consistency + boost::system::error_code ec{}; +- const auto parsed_ip = boost::asio::ip::address::from_string(config.bind_ip, ec); ++ const auto parsed_ip = boost::asio::ip::address::from_string(config.bind_ipv4_address, ec); + if (ec) + { +- LOG_ERROR(tr("Invalid IP address given for --") << arg.rpc_bind_ip.name); ++ LOG_ERROR(tr("Invalid IPv4 address given for --") << arg.rpc_bind_ipv4_address.name); + return boost::none; + } + + if (!parsed_ip.is_loopback() && !command_line::get_arg(vm, arg.confirm_external_bind)) + { + LOG_ERROR( +- "--" << arg.rpc_bind_ip.name << ++ "--" << arg.rpc_bind_ipv4_address.name << + tr(" permits inbound unencrypted external connections. Consider SSH tunnel or SSL proxy instead. Override with --") << + arg.confirm_external_bind.name + ); +@@ -175,12 +175,12 @@ namespace cryptonote + } + + +- // always parse IP here for error consistency ++ // always parse IPv6 here for error consistency + boost::system::error_code ec{}; + const auto parsed_ip = boost::asio::ip::address::from_string(config.bind_ipv6_address, ec); + if (ec) + { +- LOG_ERROR(tr("Invalid IP address given for --") << arg.rpc_bind_ipv6_address.name); ++ LOG_ERROR(tr("Invalid IPv6 address given for --") << arg.rpc_bind_ipv6_address.name); + return boost::none; + } + +@@ -194,14 +194,14 @@ namespace cryptonote + return boost::none; + } + } +- if (!config.restricted_bind_ip.empty()) ++ if (!config.restricted_bind_ipv4_address.empty()) + { +- // always parse IP here for error consistency ++ // always parse IPv4 here for error consistency + boost::system::error_code ec{}; +- boost::asio::ip::address::from_string(config.restricted_bind_ip, ec); ++ boost::asio::ip::address::from_string(config.restricted_bind_ipv4_address, ec); + if (ec) + { +- LOG_ERROR(tr("Invalid IP address given for --") << arg.rpc_restricted_bind_ip.name); ++ LOG_ERROR(tr("Invalid IPv4 address given for --") << arg.rpc_restricted_bind_ipv4_address.name); + return boost::none; + } + } +@@ -213,12 +213,12 @@ namespace cryptonote + config.restricted_bind_ipv6_address = config.restricted_bind_ipv6_address.substr(1, config.restricted_bind_ipv6_address.size() - 2); + } + +- // always parse IP here for error consistency ++ // always parse IPv6 here for error consistency + boost::system::error_code ec{}; + boost::asio::ip::address::from_string(config.restricted_bind_ipv6_address, ec); + if (ec) + { +- LOG_ERROR(tr("Invalid IP address given for --") << arg.rpc_restricted_bind_ipv6_address.name); ++ LOG_ERROR(tr("Invalid IPv6 address given for --") << arg.rpc_restricted_bind_ipv6_address.name); + return boost::none; + } + } +diff --git a/src/rpc/rpc_args.h b/src/rpc/rpc_args.h +index ac6a5d7cd4f4..b4fa3ced09a4 100644 +--- a/src/rpc/rpc_args.h ++++ b/src/rpc/rpc_args.h +@@ -51,9 +51,9 @@ namespace cryptonote + descriptors& operator=(const descriptors&) = delete; + descriptors& operator=(descriptors&&) = delete; + +- const command_line::arg_descriptor rpc_bind_ip; ++ const command_line::arg_descriptor rpc_bind_ipv4_address; + const command_line::arg_descriptor rpc_bind_ipv6_address; +- const command_line::arg_descriptor rpc_restricted_bind_ip; ++ const command_line::arg_descriptor rpc_restricted_bind_ipv4_address; + const command_line::arg_descriptor rpc_restricted_bind_ipv6_address; + const command_line::arg_descriptor rpc_use_ipv6; + const command_line::arg_descriptor rpc_ignore_ipv4; +@@ -81,9 +81,9 @@ namespace cryptonote + //! \return SSL arguments specified by user, or `boost::none` if error + static boost::optional process_ssl(const boost::program_options::variables_map& vm, const bool any_cert_option = false); + +- std::string bind_ip; ++ std::string bind_ipv4_address; + std::string bind_ipv6_address; +- std::string restricted_bind_ip; ++ std::string restricted_bind_ipv4_address; + std::string restricted_bind_ipv6_address; + bool use_ipv6; + bool require_ipv4; +diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp +index d7aa80e0acc1..f5e3c4b4e861 100644 +--- a/src/wallet/wallet_rpc_server.cpp ++++ b/src/wallet/wallet_rpc_server.cpp +@@ -280,7 +280,7 @@ namespace tools + m_net_server.set_threads_prefix("RPC"); + auto rng = [](size_t len, uint8_t *ptr) { return crypto::rand(len, ptr); }; + return epee::http_server_impl_base::init( +- rng, std::move(bind_port), std::move(rpc_config->bind_ip), ++ rng, std::move(bind_port), std::move(rpc_config->bind_ipv4_address), + std::move(rpc_config->bind_ipv6_address), std::move(rpc_config->use_ipv6), std::move(rpc_config->require_ipv4), + std::move(rpc_config->access_control_origins), std::move(http_login), + std::move(rpc_config->ssl_options) +diff --git a/tests/functional_tests/functional_tests_rpc.py b/tests/functional_tests/functional_tests_rpc.py +index 7e4d49ffaad1..8c8a8cfd0110 100755 +--- a/tests/functional_tests/functional_tests_rpc.py ++++ b/tests/functional_tests/functional_tests_rpc.py +@@ -52,7 +52,7 @@ WALLET_DIRECTORY = builddir + "/functional-tests-directory" + FUNCTIONAL_TESTS_DIRECTORY = builddir + "/tests/functional_tests" + DIFFICULTY = 10 + +-monerod_base = [builddir + "/bin/monerod", "--regtest", "--fixed-difficulty", str(DIFFICULTY), "--no-igd", "--p2p-bind-port", "monerod_p2p_port", "--rpc-bind-port", "monerod_rpc_port", "--zmq-rpc-bind-port", "monerod_zmq_port", "--zmq-pub", "monerod_zmq_pub", "--non-interactive", "--disable-dns-checkpoints", "--check-updates", "disabled", "--rpc-ssl", "disabled", "--data-dir", "monerod_data_dir", "--log-level", "1"] ++monerod_base = [builddir + "/bin/monerod", "--regtest", "--fixed-difficulty", str(DIFFICULTY), "--no-igd", "--p2p-bind-port-ipv4", "monerod_p2p_port", "--rpc-bind-port", "monerod_rpc_port", "--zmq-rpc-bind-port", "monerod_zmq_port", "--zmq-pub", "monerod_zmq_pub", "--non-interactive", "--disable-dns-checkpoints", "--check-updates", "disabled", "--rpc-ssl", "disabled", "--data-dir", "monerod_data_dir", "--log-level", "1"] + monerod_extra = [ + ["--offline"], + ["--rpc-payment-address", "44SKxxLQw929wRF6BA9paQ1EWFshNnKhXM3qz6Mo3JGDE2YG3xyzVutMStEicxbQGRfrYvAAYxH6Fe8rnD56EaNwUiqhcwR", "--rpc-payment-difficulty", str(DIFFICULTY), "--rpc-payment-credits", "5000", "--offline"], +diff --git a/tests/trezor/daemon.cpp b/tests/trezor/daemon.cpp +index de4f9bc51a1f..308fa6fc0876 100644 +--- a/tests/trezor/daemon.cpp ++++ b/tests/trezor/daemon.cpp +@@ -55,7 +55,7 @@ void mock_daemon::default_options(boost::program_options::variables_map & vm) + std::vector exclusive_nodes{"127.0.0.1:65525"}; + tools::options::set_option(vm, nodetool::arg_p2p_add_exclusive_node, po::variable_value(exclusive_nodes, false)); + +- tools::options::set_option(vm, nodetool::arg_p2p_bind_ip, po::variable_value(std::string("127.0.0.1"), false)); ++ tools::options::set_option(vm, nodetool::arg_p2p_bind_ipv4_address, po::variable_value(std::string("127.0.0.1"), false)); + tools::options::set_option(vm, nodetool::arg_no_igd, po::variable_value(true, false)); + tools::options::set_option(vm, cryptonote::arg_offline, po::variable_value(true, false)); + tools::options::set_option(vm, "disable-dns-checkpoints", po::variable_value(true, false)); +@@ -69,7 +69,7 @@ void mock_daemon::default_options(boost::program_options::variables_map & vm) + // By default pick non-standard ports to avoid confusion with possibly locally running daemons (mainnet/testnet) + const char *test_p2p_port = getenv("TEST_P2P_PORT"); + auto p2p_port = std::string(test_p2p_port && strlen(test_p2p_port) > 0 ? test_p2p_port : "61340"); +- tools::options::set_option(vm, nodetool::arg_p2p_bind_port, po::variable_value(p2p_port, false)); ++ tools::options::set_option(vm, nodetool::arg_p2p_bind_port_ipv4, po::variable_value(p2p_port, false)); + + const char *test_rpc_port = getenv("TEST_RPC_PORT"); + auto rpc_port = std::string(test_rpc_port && strlen(test_rpc_port) > 0 ? test_rpc_port : "61341"); +@@ -85,7 +85,7 @@ void mock_daemon::default_options(boost::program_options::variables_map & vm) + void mock_daemon::set_ports(boost::program_options::variables_map & vm, unsigned initial_port) + { + CHECK_AND_ASSERT_THROW_MES(initial_port < 65535-2, "Invalid port number"); +- tools::options::set_option(vm, nodetool::arg_p2p_bind_port, po::variable_value(std::to_string(initial_port), false)); ++ tools::options::set_option(vm, nodetool::arg_p2p_bind_port_ipv4, po::variable_value(std::to_string(initial_port), false)); + tools::options::set_option(vm, cryptonote::core_rpc_server::arg_rpc_bind_port, po::variable_value(std::to_string(initial_port + 1), false)); + tools::options::set_option(vm, daemon_args::arg_zmq_rpc_bind_port, po::variable_value(std::to_string(initial_port + 2), false)); + po::notify(vm); +@@ -93,7 +93,7 @@ void mock_daemon::set_ports(boost::program_options::variables_map & vm, unsigned + + void mock_daemon::load_params(boost::program_options::variables_map const & vm) + { +- m_p2p_bind_port = command_line::get_arg(vm, nodetool::arg_p2p_bind_port); ++ m_p2p_bind_port = command_line::get_arg(vm, nodetool::arg_p2p_bind_port_ipv4); + m_rpc_bind_port = command_line::get_arg(vm, cryptonote::core_rpc_server::arg_rpc_bind_port); + m_zmq_bind_port = command_line::get_arg(vm, daemon_args::arg_zmq_rpc_bind_port); + m_network_type = command_line::get_arg(vm, cryptonote::arg_testnet_on) ? cryptonote::TESTNET : cryptonote::MAINNET; +diff --git a/tests/unit_tests/node_server.cpp b/tests/unit_tests/node_server.cpp +index 6f490d7b9438..584ca3d63884 100644 +--- a/tests/unit_tests/node_server.cpp ++++ b/tests/unit_tests/node_server.cpp +@@ -309,8 +309,8 @@ TEST(node_server, bind_same_p2p_port) + For Mac OSX and OpenBSD, set the following alias (by running the command as root), before running the test, or else it will fail: + ifconfig lo0 alias 127.0.0.2 + */ +- vm.find(nodetool::arg_p2p_bind_ip.name)->second = boost::program_options::variable_value(std::string("127.0.0.2"), false); +- vm.find(nodetool::arg_p2p_bind_port.name)->second = boost::program_options::variable_value(std::string(port), false); ++ vm.find(nodetool::arg_p2p_bind_ipv4_address.name)->second = boost::program_options::variable_value(std::string("127.0.0.2"), false); ++ vm.find(nodetool::arg_p2p_bind_port_ipv4.name)->second = boost::program_options::variable_value(std::string(port), false); + + boost::program_options::notify(vm); + +@@ -1140,8 +1140,8 @@ TEST(node_server, race_condition) + options_t options; + boost::program_options::store( + boost::program_options::command_line_parser({ +- "--p2p-bind-ip=127.0.0.1", +- "--p2p-bind-port=48080", ++ "--p2p-bind-ipv4-address=127.0.0.1", ++ "--p2p-bind-port-ipv4=48080", + "--out-peers=0", + "--data-dir", + dir.string(), +diff --git a/translations/monero.ts b/translations/monero.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero.ts ++++ b/translations/monero.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_ar.ts b/translations/monero_ar.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_ar.ts ++++ b/translations/monero_ar.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_bg.ts b/translations/monero_bg.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_bg.ts ++++ b/translations/monero_bg.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_bn.ts b/translations/monero_bn.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_bn.ts ++++ b/translations/monero_bn.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_cat.ts b/translations/monero_cat.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_cat.ts ++++ b/translations/monero_cat.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_cs.ts b/translations/monero_cs.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_cs.ts ++++ b/translations/monero_cs.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_da.ts b/translations/monero_da.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_da.ts ++++ b/translations/monero_da.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_de.ts b/translations/monero_de.ts +index 2dddbecdfe97..dfd628fa3e0b 100644 +--- a/translations/monero_de.ts ++++ b/translations/monero_de.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + Ungültige IP-Adresse angegeben für -- + + +diff --git a/translations/monero_el.ts b/translations/monero_el.ts +index a86be63e8235..29afbfecd475 100644 +--- a/translations/monero_el.ts ++++ b/translations/monero_el.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_eo.ts b/translations/monero_eo.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_eo.ts ++++ b/translations/monero_eo.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_es.ts b/translations/monero_es.ts +index f9bd121aeddc..2bf0eb3a1319 100644 +--- a/translations/monero_es.ts ++++ b/translations/monero_es.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_fa.ts b/translations/monero_fa.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_fa.ts ++++ b/translations/monero_fa.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_fi.ts b/translations/monero_fi.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_fi.ts ++++ b/translations/monero_fi.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_fr.ts b/translations/monero_fr.ts +index 8d5ec26f3be2..8adeb402e093 100644 +--- a/translations/monero_fr.ts ++++ b/translations/monero_fr.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + Spécifier l'IP à laquelle lier le serveur RPC + + +@@ -586,8 +586,8 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP +- Confirmer que la valeur de rpc-bind-ip n'est PAS une IP de bouclage (locale) ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP ++ Confirmer que la valeur de rpc-bind-ipv4-address n'est PAS une IP de bouclage (locale) + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + Adresse IP invalide fournie pour -- + + +diff --git a/translations/monero_ga.ts b/translations/monero_ga.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_ga.ts ++++ b/translations/monero_ga.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_he.ts b/translations/monero_he.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_he.ts ++++ b/translations/monero_he.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_hi.ts b/translations/monero_hi.ts +index 8041a90dacdc..3fd6b17e301f 100644 +--- a/translations/monero_hi.ts ++++ b/translations/monero_hi.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + RPC सर्वर को बाँधने के लिए IP निर्दिष्ट करें + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + Rpc-bind-ip के मान की पुष्टि करें की वह लूपबैक (स्थानीय) IP तो नहीं है + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + -- के लिए दिया गया अमान्य IP पता + + +diff --git a/translations/monero_hr.ts b/translations/monero_hr.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_hr.ts ++++ b/translations/monero_hr.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_hu.ts b/translations/monero_hu.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_hu.ts ++++ b/translations/monero_hu.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_id.ts b/translations/monero_id.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_id.ts ++++ b/translations/monero_id.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_is.ts b/translations/monero_is.ts +index 6eec6b9a4544..22e1f666d436 100644 +--- a/translations/monero_is.ts ++++ b/translations/monero_is.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_it.ts b/translations/monero_it.ts +index e90c9949c92d..44b3a5f3ee46 100644 +--- a/translations/monero_it.ts ++++ b/translations/monero_it.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + Specificare IP da associare al server RPC + + +@@ -586,8 +586,8 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP +- Conferma valore rpc-bind-ip NON è un loopback IP (locale) ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP ++ Conferma valore rpc-bind-ipv4-address NON è un loopback IP (locale) + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + Indirizzo IP non valido dato per -- + + +diff --git a/translations/monero_ja.ts b/translations/monero_ja.ts +index 3b457ecc534c..a77b90cf340a 100644 +--- a/translations/monero_ja.ts ++++ b/translations/monero_ja.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + RPCサーバに接続するIPを指定してください + + +@@ -586,8 +586,8 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP +- rpc-bind-ipの価はループバック(ローカル)IPじゃないことを確認してください ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP ++ rpc-bind-ipv4-addressの価はループバック(ローカル)IPじゃないことを確認してください + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + このRPCサーバーのIPはだめです -- + + +diff --git a/translations/monero_kmr.ts b/translations/monero_kmr.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_kmr.ts ++++ b/translations/monero_kmr.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_ko.ts b/translations/monero_ko.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_ko.ts ++++ b/translations/monero_ko.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_lt.ts b/translations/monero_lt.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_lt.ts ++++ b/translations/monero_lt.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_nb_NO.ts b/translations/monero_nb_NO.ts +index 76926378cf5a..529f067d321c 100644 +--- a/translations/monero_nb_NO.ts ++++ b/translations/monero_nb_NO.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_ne.ts b/translations/monero_ne.ts +index 126d3493bd36..6b80693d2ad6 100644 +--- a/translations/monero_ne.ts ++++ b/translations/monero_ne.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_nl.ts b/translations/monero_nl.ts +index 34a9365866fe..b942aa97d92e 100644 +--- a/translations/monero_nl.ts ++++ b/translations/monero_nl.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_pl.ts b/translations/monero_pl.ts +index 401d99101be9..bd5baabdddd8 100644 +--- a/translations/monero_pl.ts ++++ b/translations/monero_pl.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_prt.ts b/translations/monero_prt.ts +index 4a20eaec99e6..ed5e9f5ffc50 100644 +--- a/translations/monero_prt.ts ++++ b/translations/monero_prt.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_pt-br.ts b/translations/monero_pt-br.ts +index cf533083e68b..de14654fc9e8 100644 +--- a/translations/monero_pt-br.ts ++++ b/translations/monero_pt-br.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_pt-pt.ts b/translations/monero_pt-pt.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_pt-pt.ts ++++ b/translations/monero_pt-pt.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_ro.ts b/translations/monero_ro.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_ro.ts ++++ b/translations/monero_ro.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_ru.ts b/translations/monero_ru.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_ru.ts ++++ b/translations/monero_ru.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_sk.ts b/translations/monero_sk.ts +index f5d490dd97a6..673fbd14d54a 100644 +--- a/translations/monero_sk.ts ++++ b/translations/monero_sk.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_sl.ts b/translations/monero_sl.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_sl.ts ++++ b/translations/monero_sl.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_sr.ts b/translations/monero_sr.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_sr.ts ++++ b/translations/monero_sr.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_sv.ts b/translations/monero_sv.ts +index 1f75ce40e559..7d5267d661ee 100644 +--- a/translations/monero_sv.ts ++++ b/translations/monero_sv.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + Ange IP-adress för att binda till RPC-server + + +@@ -586,8 +586,8 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP +- Bekräftelsevärde för rpc-bind-ip är INTE en lokal IP-adress (loopback) ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP ++ Bekräftelsevärde för rpc-bind-ipv4-address är INTE en lokal IP-adress (loopback) + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + Ogiltig IP-adress angiven för -- + + +diff --git a/translations/monero_tr.ts b/translations/monero_tr.ts +index 071a13b3a9d0..35f95cc2308a 100644 +--- a/translations/monero_tr.ts ++++ b/translations/monero_tr.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_uk.ts b/translations/monero_uk.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_uk.ts ++++ b/translations/monero_uk.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_ur.ts b/translations/monero_ur.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_ur.ts ++++ b/translations/monero_ur.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_zh-cn.ts b/translations/monero_zh-cn.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_zh-cn.ts ++++ b/translations/monero_zh-cn.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_zh-tw.ts b/translations/monero_zh-tw.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_zh-tw.ts ++++ b/translations/monero_zh-tw.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_zu.ts b/translations/monero_zu.ts +index 56ce17644564..e1dc084654d9 100644 +--- a/translations/monero_zu.ts ++++ b/translations/monero_zu.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/translations/monero_zu.ts.ts b/translations/monero_zu.ts.ts +index ff53103517e0..546d81ad1a25 100644 +--- a/translations/monero_zu.ts.ts ++++ b/translations/monero_zu.ts.ts +@@ -561,7 +561,7 @@ + cryptonote::rpc_args + + +- Specify IP to bind RPC server ++ Specify IPv4 address to bind RPC server + + + +@@ -586,7 +586,7 @@ + + + +- Confirm rpc-bind-ip value is NOT a loopback (local) IP ++ Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP + + + +@@ -632,7 +632,7 @@ + + + +- Invalid IP address given for -- ++ Invalid IPv4 address given for -- + + + +diff --git a/utils/fish/monero-wallet-rpc.fish b/utils/fish/monero-wallet-rpc.fish +index d89f58b49d60..c06f01b0352a 100644 +--- a/utils/fish/monero-wallet-rpc.fish ++++ b/utils/fish/monero-wallet-rpc.fish +@@ -34,14 +34,14 @@ complete -c monero-wallet-cli -l allow-mismatched-daemon-version -d "Allow commu + complete -c monero-wallet-rpc -l rpc-bind-port -r -d "Sets bind port for server" + complete -c monero-wallet-rpc -l disable-rpc-login -d "Disable HTTP authentication for RPC connections served by this process" + complete -c monero-wallet-rpc -l restricted-rpc -d "Restricts to view-only commands" +-complete -c monero-wallet-rpc -l rpc-bind-ip -r -d "Specify IP to bind RPC server. Default: 127.0.0.1" ++complete -c monero-wallet-rpc -l rpc-bind-ipv4-address -r -d "Specify IPv4 address to bind RPC server. Default: 127.0.0.1" + complete -c monero-wallet-rpc -l rpc-bind-ipv6-address -r -d "Specify IPv6 address to bind RPC server. Default: ::1" +-complete -c monero-wallet-rpc -l rpc-restricted-bind-ip -r -d "Specify IP to bind restricted RPC server. Default: 127.0.0.1" ++complete -c monero-wallet-rpc -l rpc-restricted-bind-ipv4-address -r -d "Specify IPv4 address to bind restricted RPC server. Default: 127.0.0.1" + complete -c monero-wallet-rpc -l rpc-restricted-bind-ipv6-address -r -d "Specify IPv6 address to bind restricted RPC server. Default: ::1" + complete -c monero-wallet-rpc -l rpc-use-ipv6 -d "Allow IPv6 for RPC" + complete -c monero-wallet-rpc -l rpc-ignore-ipv4 -d "Ignore unsuccessful IPv4 bind for RPC" + complete -c monero-wallet-rpc -l rpc-login -r -d "Specify username[:password] required for RPC server" +-complete -c monero-wallet-rpc -l confirm-external-bind -d "Confirm rpc-bind-ip value is NOT a loopback (local) IP" ++complete -c monero-wallet-rpc -l confirm-external-bind -d "Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP" + complete -c monero-wallet-rpc -l rpc-access-control-origins -r -d "Specify a comma separated list of origins to allow cross origin resource sharing" + complete -c monero-wallet-rpc -l rpc-ssl -x -a "enabled disabled autodetect" -d "Enable SSL on RPC connections. Default: autodetect" + complete -c monero-wallet-rpc -l rpc-ssl-private-key -r -k -a "(__fish_complete_suffix .pem)" -d "Path to a PEM format private key" +diff --git a/utils/fish/monerod.fish b/utils/fish/monerod.fish +index 29be7c3ec106..e1b3551eec9b 100644 +--- a/utils/fish/monerod.fish ++++ b/utils/fish/monerod.fish +@@ -54,9 +54,9 @@ complete -c monerod -l bg-mining-idle-threshold -r -d "Specify minimum avg idle + complete -c monerod -l bg-mining-miner-target -r -d "Specify maximum percentage cpu use by miner(s)" + complete -c monerod -l db-sync-mode -r -d "Specify sync option, using format [safe|fast|fastest]:[sync|async]:[[blocks]| [bytes]]. Default: fast:async:250000000bytes" + complete -c monerod -l db-salvage -d "Try to salvage a blockchain database if it seems corrupted" +-complete -c monerod -l p2p-bind-ip -r -d "Interface for p2p network protocol (IPv4). Default: 0.0.0.0" ++complete -c monerod -l p2p-bind-ipv4-address -r -d "Interface for p2p network protocol (IPv4). Default: 0.0.0.0" + complete -c monerod -l p2p-bind-ipv6-address -r -d "Interface for p2p network protocol (IPv6). Default: ::" +-complete -c monerod -l p2p-bind-port -r -d "Port for p2p network protocol (IPv4). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" ++complete -c monerod -l p2p-bind-port-ipv4 -r -d "Port for p2p network protocol (IPv4). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" + complete -c monerod -l p2p-bind-port-ipv6 -d "Port for p2p network protocol (IPv6). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" + complete -c monerod -l p2p-use-ipv6 -d "Enable IPv6 for p2p" + complete -c monerod -l p2p-ignore-ipv4 -d "Ignore unsuccessful IPv4 bind for p2p" +@@ -88,14 +88,14 @@ complete -c monerod -l restricted-rpc -d "Restrict RPC to view only commands and + complete -c monerod -l bootstrap-daemon-address -r -d "URL of a 'bootstrap' remote daemon that the connected wallets can use while this daemon is still not fully synced. Use 'auto' to enable automatic public nodes discovering and bootstrap daemon switching" + complete -c monerod -l bootstrap-daemon-login -r -d "Specify username:password for the bootstrap daemon login" + complete -c monerod -l bootstrap-daemon-proxy -r -d ": socks proxy to use for bootstrap daemon connections" +-complete -c monerod -l rpc-bind-ip -r -d "Specify IP to bind RPC server. Default: 127.0.0.1" ++complete -c monerod -l rpc-bind-ipv4-address -r -d "Specify IPv4 address to bind RPC server. Default: 127.0.0.1" + complete -c monerod -l rpc-bind-ipv6-address -r -d "Specify IPv6 address to bind RPC server. Default: ::1" +-complete -c monerod -l rpc-restricted-bind-ip -r -d "Specify IP to bind restricted RPC server. Default: 127.0.0.1" ++complete -c monerod -l rpc-restricted-bind-ipv4-address -r -d "Specify IPv4 address to bind restricted RPC server. Default: 127.0.0.1" + complete -c monerod -l rpc-restricted-bind-ipv6-address -r -d "Specify IPv6 address to bind restricted RPC server. Default: ::1" + complete -c monerod -l rpc-use-ipv6 -d "Allow IPv6 for RPC" + complete -c monerod -l rpc-ignore-ipv4 -d "Ignore unsuccessful IPv4 bind for RPC" + complete -c monerod -l rpc-login -d "Specify username[:password] required for RPC server" +-complete -c monerod -l confirm-external-bind -d "Confirm rpc-bind-ip value is NOT a loopback (local) IP" ++complete -c monerod -l confirm-external-bind -d "Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP" + complete -c monerod -l rpc-access-control-origins -r -d "Specify a comma separated list of origins to allow cross origin resource sharing" + complete -c monerod -l rpc-ssl -x -a "enabled disabled autodetect" -d "Enable SSL on RPC connections. Default: autodetect" + complete -c monerod -l rpc-ssl-private-key -r -k -a "(__fish_complete_suffix .pem)" -d "Path to a PEM format private key" diff --git a/net-p2p/monero/files/monero-9999-net-enable-IPv6-by-default.patch b/net-p2p/monero/files/monero-9999-net-enable-IPv6-by-default.patch new file mode 100644 index 00000000..73841edc --- /dev/null +++ b/net-p2p/monero/files/monero-9999-net-enable-IPv6-by-default.patch @@ -0,0 +1,496 @@ +From 8fa4962ae12329fa0965e80b5f945eb2ada63b0e Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sun, 17 Jul 2022 23:52:34 +0100 +Subject: [PATCH] net: enable IPv6 by default + +As of 2024-04-01, IPv6 represents ~43% of traffic entering Google with +up to 75% is some country, and in generally more available when IPv6 was +introduced in Monero in 2019 as part of 155475d97196 ("Add IPv6 +support"). + +Monero overall has a very low presence over IPv6 which in part can be +explained from the fact that IPv6 need to be specifically enabled before +it is used and often requires nodes to be manually added in +configuration. + +This commit enabled IPv6 by default for both RPC and P2P as an attempt +to improve Monero network mesh diversity. + +The change has been tested in a lot of different scenario: IPv4 only, +IPv6 only, IPv4+IPv6, IPv4+IPv6 with broken/invalid IPv4 system +configuration, IPv4+IPv6 with broken/invalid IPv6 system configuration. + +* --p2p-use-ipv6 is now deprecated and has no effect +* --p2p-ignore-ipv6 is introduced to ignore unsuccessful IPv6 P2P binding +* --rpc-use-ipv6 is now deprecated and has no effect +* --rpc-ignore-ipv6 is introduced to ignore unsuccessful IPv6 RPC binding + +See: https://github.com/monero-project/monero/issues/8818 +See: https://www.google.com/intl/en/ipv6/statistics.html +See: https://www.vyncke.org/ipv6status/ +--- + .../epee/include/net/abstract_tcp_server2.h | 8 +- + .../epee/include/net/abstract_tcp_server2.inl | 78 ++++++++++--------- + .../epee/include/net/http_server_impl_base.h | 6 +- + src/p2p/net_node.cpp | 3 +- + src/p2p/net_node.h | 11 +-- + src/p2p/net_node.inl | 18 +++-- + src/rpc/core_rpc_server.cpp | 2 +- + src/rpc/rpc_args.cpp | 13 +++- + src/rpc/rpc_args.h | 5 +- + src/wallet/wallet_rpc_server.cpp | 2 +- + utils/fish/monero-wallet-rpc.fish | 2 +- + utils/fish/monerod.fish | 4 +- + 12 files changed, 85 insertions(+), 67 deletions(-) + +diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h +index ece9c1d1337f..1858df9e9064 100644 +--- a/contrib/epee/include/net/abstract_tcp_server2.h ++++ b/contrib/epee/include/net/abstract_tcp_server2.h +@@ -343,10 +343,10 @@ namespace net_utils + void create_server_type_map(); + + bool init_server(uint32_t port_ipv4, const std::string& address_ipv4 = "0.0.0.0", +- uint32_t port_ipv6 = 0, const std::string& address_ipv6 = "::", bool use_ipv6 = false, bool require_ipv4 = true, ++ uint32_t port_ipv6 = 0, const std::string& address_ipv6 = "::", bool require_ipv6 = true, bool require_ipv4 = true, + ssl_options_t ssl_options = ssl_support_t::e_ssl_support_autodetect); + bool init_server(const std::string port_ipv4, const std::string& address_ipv4 = "0.0.0.0", +- const std::string port_ipv6 = "", const std::string address_ipv6 = "::", bool use_ipv6 = false, bool require_ipv4 = true, ++ const std::string port_ipv6 = "", const std::string address_ipv6 = "::", bool require_ipv6 = true, bool require_ipv4 = true, + ssl_options_t ssl_options = ssl_support_t::e_ssl_support_autodetect); + + /// Run the server's io_service loop. +@@ -473,7 +473,7 @@ namespace net_utils + /// Handle completion of an asynchronous accept operation. + void handle_accept_ipv4(const boost::system::error_code& e); + void handle_accept_ipv6(const boost::system::error_code& e); +- void handle_accept(const boost::system::error_code& e, bool ipv6 = false); ++ void handle_accept(const boost::system::error_code& e, bool ipv6 = true); + + bool is_thread_worker(); + +@@ -502,7 +502,7 @@ namespace net_utils + uint32_t m_port_ipv6; + std::string m_address_ipv4; + std::string m_address_ipv6; +- bool m_use_ipv6; ++ bool m_require_ipv6; + bool m_require_ipv4; + std::string m_thread_name_prefix; //TODO: change to enum server_type, now used + size_t m_threads_count; +diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl +index a9409baf5ae1..cb25d1eb25b0 100644 +--- a/contrib/epee/include/net/abstract_tcp_server2.inl ++++ b/contrib/epee/include/net/abstract_tcp_server2.inl +@@ -1179,7 +1179,7 @@ namespace net_utils + //--------------------------------------------------------------------------------- + template + bool boosted_tcp_server::init_server(uint32_t port_ipv4, const std::string& address_ipv4, +- uint32_t port_ipv6, const std::string& address_ipv6, bool use_ipv6, bool require_ipv4, ++ uint32_t port_ipv6, const std::string& address_ipv6, bool require_ipv6, bool require_ipv4, + ssl_options_t ssl_options) + { + TRY_ENTRY(); +@@ -1188,7 +1188,7 @@ namespace net_utils + m_port_ipv6 = port_ipv6; + m_address_ipv4 = address_ipv4; + m_address_ipv6 = address_ipv6; +- m_use_ipv6 = use_ipv6; ++ m_require_ipv6 = require_ipv6; + m_require_ipv4 = require_ipv4; + + if (ssl_options) +@@ -1229,43 +1229,45 @@ namespace net_utils + } + } + +- if (use_ipv6) ++ try + { +- try +- { +- if (port_ipv6 == 0) port_ipv6 = port_ipv4; // default arg means bind to same port as ipv4 +- boost::asio::ip::tcp::resolver resolver(io_service_); +- boost::asio::ip::tcp::resolver::query query(address_ipv6, boost::lexical_cast(port_ipv6), boost::asio::ip::tcp::resolver::query::canonical_name); +- boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); +- acceptor_ipv6.open(endpoint.protocol()); ++ if (port_ipv6 == 0) port_ipv6 = port_ipv4; // default arg means bind to same port as ipv4 ++ boost::asio::ip::tcp::resolver resolver(io_service_); ++ boost::asio::ip::tcp::resolver::query query(address_ipv6, boost::lexical_cast(port_ipv6), boost::asio::ip::tcp::resolver::query::canonical_name); ++ boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); ++ acceptor_ipv6.open(endpoint.protocol()); + #if !defined(_WIN32) +- acceptor_ipv6.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); ++ acceptor_ipv6.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); + #endif +- acceptor_ipv6.set_option(boost::asio::ip::v6_only(true)); +- acceptor_ipv6.bind(endpoint); +- acceptor_ipv6.listen(); +- boost::asio::ip::tcp::endpoint binded_endpoint = acceptor_ipv6.local_endpoint(); +- m_port_ipv6 = binded_endpoint.port(); +- MDEBUG("start accept (IPv6)"); +- new_connection_ipv6.reset(new connection(io_service_, m_state, m_connection_type, m_state->ssl_options().support)); +- acceptor_ipv6.async_accept(new_connection_ipv6->socket(), +- boost::bind(&boosted_tcp_server::handle_accept_ipv6, this, +- boost::asio::placeholders::error)); +- } +- catch (const std::exception &e) +- { +- ipv6_failed = e.what(); +- } ++ acceptor_ipv6.set_option(boost::asio::ip::v6_only(true)); ++ acceptor_ipv6.bind(endpoint); ++ acceptor_ipv6.listen(); ++ boost::asio::ip::tcp::endpoint binded_endpoint = acceptor_ipv6.local_endpoint(); ++ m_port_ipv6 = binded_endpoint.port(); ++ MDEBUG("start accept (IPv6)"); ++ new_connection_ipv6.reset(new connection(io_service_, m_state, m_connection_type, m_state->ssl_options().support)); ++ acceptor_ipv6.async_accept(new_connection_ipv6->socket(), ++ boost::bind(&boosted_tcp_server::handle_accept_ipv6, this, ++ boost::asio::placeholders::error)); ++ } ++ catch (const std::exception &e) ++ { ++ ipv6_failed = e.what(); + } + +- if (use_ipv6 && ipv6_failed != "") ++ if (ipv6_failed != "") ++ { ++ MERROR("Failed to bind IPv6: " << ipv6_failed); ++ if (require_ipv6) + { +- MERROR("Failed to bind IPv6: " << ipv6_failed); +- if (ipv4_failed != "") +- { +- throw std::runtime_error("Failed to bind IPv4 and IPv6"); +- } ++ throw std::runtime_error("Failed to bind IPv6 (set to required)"); + } ++ } ++ ++ if (ipv4_failed != "" && ipv6_failed != "") ++ { ++ throw std::runtime_error("Failed to bind IPv4 and IPv6"); ++ } + + return true; + } +@@ -1283,7 +1285,7 @@ namespace net_utils + //----------------------------------------------------------------------------- + template + bool boosted_tcp_server::init_server(const std::string port_ipv4, const std::string& address_ipv4, +- const std::string port_ipv6, const std::string address_ipv6, bool use_ipv6, bool require_ipv4, ++ const std::string port_ipv6, const std::string address_ipv6, bool require_ipv6, bool require_ipv4, + ssl_options_t ssl_options) + { + uint32_t p_ipv4 = 0; +@@ -1298,7 +1300,7 @@ namespace net_utils + MERROR("Failed to convert port no = " << port_ipv6); + return false; + } +- return this->init_server(p_ipv4, address_ipv4, p_ipv6, address_ipv6, use_ipv6, require_ipv4, std::move(ssl_options)); ++ return this->init_server(p_ipv4, address_ipv4, p_ipv6, address_ipv6, require_ipv6, require_ipv4, std::move(ssl_options)); + } + //--------------------------------------------------------------------------------- + template +@@ -1389,7 +1391,7 @@ namespace net_utils + { + //some problems with the listening socket ?.. + _dbg1("Net service stopped without stop request, restarting..."); +- if(!this->init_server(m_port_ipv4, m_address_ipv4, m_port_ipv6, m_address_ipv6, m_use_ipv6, m_require_ipv4)) ++ if(!this->init_server(m_port_ipv4, m_address_ipv4, m_port_ipv6, m_address_ipv6, m_require_ipv6, m_require_ipv4)) + { + _dbg1("Reiniting service failed, exit."); + return false; +@@ -1682,7 +1684,7 @@ namespace net_utils + } + catch (const boost::system::system_error& e) + { +- if (!m_use_ipv6 || (resolve_error != boost::asio::error::host_not_found && ++ if (!m_require_ipv6 || (resolve_error != boost::asio::error::host_not_found && + resolve_error != boost::asio::error::host_not_found_try_again)) + { + throw; +@@ -1699,7 +1701,7 @@ namespace net_utils + boost::asio::ip::tcp::resolver::iterator end; + if(iterator == end) + { +- if (!m_use_ipv6) ++ if (!m_require_ipv6) + { + _erro("Failed to resolve " << adr); + return false; +@@ -1807,7 +1809,7 @@ namespace net_utils + } + catch (const boost::system::system_error& e) + { +- if (!m_use_ipv6 || (resolve_error != boost::asio::error::host_not_found && ++ if (!m_require_ipv6 || (resolve_error != boost::asio::error::host_not_found && + resolve_error != boost::asio::error::host_not_found_try_again)) + { + throw; +diff --git a/contrib/epee/include/net/http_server_impl_base.h b/contrib/epee/include/net/http_server_impl_base.h +index 94d519716918..b617952f3846 100644 +--- a/contrib/epee/include/net/http_server_impl_base.h ++++ b/contrib/epee/include/net/http_server_impl_base.h +@@ -57,7 +57,7 @@ namespace epee + {} + + bool init(std::function rng, const std::string& bind_port = "0", const std::string& bind_address_ipv4 = "0.0.0.0", +- const std::string& bind_address_ipv6 = "::", bool use_ipv6 = false, bool require_ipv4 = true, ++ const std::string& bind_address_ipv6 = "::", bool require_ipv6 = true, bool require_ipv4 = true, + std::vector access_control_origins = std::vector(), + boost::optional user = boost::none, + net_utils::ssl_options_t ssl_options = net_utils::ssl_support_t::e_ssl_support_autodetect) +@@ -77,11 +77,11 @@ namespace epee + m_net_server.get_config_object().m_user = std::move(user); + + MGINFO("Binding on " << bind_address_ipv4 << " (IPv4):" << bind_port); +- if (use_ipv6) ++ if (require_ipv6) + { + MGINFO("Binding on " << bind_address_ipv6 << " (IPv6):" << bind_port); + } +- bool res = m_net_server.init_server(bind_port, bind_address_ipv4, bind_port, bind_address_ipv6, use_ipv6, require_ipv4, std::move(ssl_options)); ++ bool res = m_net_server.init_server(bind_port, bind_address_ipv4, bind_port, bind_address_ipv6, require_ipv6, require_ipv4, std::move(ssl_options)); + if(!res) + { + LOG_ERROR("Failed to bind server"); +diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp +index 4d5ba6e38268..5ac484ea7b77 100644 +--- a/src/p2p/net_node.cpp ++++ b/src/p2p/net_node.cpp +@@ -159,7 +159,8 @@ namespace nodetool + + const command_line::arg_descriptor arg_no_igd = {"no-igd", "Disable UPnP port mapping"}; + const command_line::arg_descriptor arg_igd = {"igd", "UPnP port mapping (disabled, enabled, delayed)", "delayed"}; +- const command_line::arg_descriptor arg_p2p_use_ipv6 = {"p2p-use-ipv6", "Enable IPv6 for p2p", false}; ++ const command_line::arg_descriptor arg_p2p_use_ipv6 = {"p2p-use-ipv6", "DEPRECATED, ignored", false}; ++ const command_line::arg_descriptor arg_p2p_ignore_ipv6 = {"p2p-ignore-ipv6", "Ignore unsuccessful IPv6 bind for p2p", false}; + const command_line::arg_descriptor arg_p2p_ignore_ipv4 = {"p2p-ignore-ipv4", "Ignore unsuccessful IPv4 bind for p2p", false}; + const command_line::arg_descriptor arg_out_peers = {"out-peers", "set max number of out peers", -1}; + const command_line::arg_descriptor arg_in_peers = {"in-peers", "set max number of in peers", -1}; +diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h +index 4db6a107ca0a..b0218baf1b73 100644 +--- a/src/p2p/net_node.h ++++ b/src/p2p/net_node.h +@@ -375,11 +375,11 @@ namespace nodetool + bool is_peer_used(const peerlist_entry& peer); + bool is_peer_used(const anchor_peerlist_entry& peer); + bool is_addr_connected(const epee::net_utils::network_address& peer); +- void add_upnp_port_mapping_impl(uint32_t port, bool ipv6=false); ++ void add_upnp_port_mapping_impl(uint32_t port, bool ipv6=true); + void add_upnp_port_mapping_v4(uint32_t port); + void add_upnp_port_mapping_v6(uint32_t port); +- void add_upnp_port_mapping(uint32_t port, bool ipv4=true, bool ipv6=false); +- void delete_upnp_port_mapping_impl(uint32_t port, bool ipv6=false); ++ void add_upnp_port_mapping(uint32_t port, bool ipv4=true, bool ipv6=true); ++ void delete_upnp_port_mapping_impl(uint32_t port, bool ipv6=true); + void delete_upnp_port_mapping_v4(uint32_t port); + void delete_upnp_port_mapping_v6(uint32_t port); + void delete_upnp_port_mapping(uint32_t port); +@@ -457,7 +457,7 @@ namespace nodetool + bool m_hide_my_port; + igd_t m_igd; + bool m_offline; +- bool m_use_ipv6; ++ bool m_require_ipv6; + bool m_require_ipv4; + std::atomic is_closing; + std::unique_ptr mPeersLoggerThread; +@@ -527,7 +527,8 @@ namespace nodetool + extern const command_line::arg_descriptor arg_p2p_bind_ipv6_port; + extern const command_line::arg_descriptor arg_p2p_bind_port; // DEPRECATED + extern const command_line::arg_descriptor arg_p2p_bind_port_ipv6; // DEPRECATED +- extern const command_line::arg_descriptor arg_p2p_use_ipv6; ++ extern const command_line::arg_descriptor arg_p2p_use_ipv6; // DEPRECATED ++ extern const command_line::arg_descriptor arg_p2p_ignore_ipv6; + extern const command_line::arg_descriptor arg_p2p_ignore_ipv4; + extern const command_line::arg_descriptor arg_p2p_external_port; + extern const command_line::arg_descriptor arg_p2p_allow_local_ip; +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index f357c6037800..09dead8a7691 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -106,7 +106,8 @@ namespace nodetool + command_line::add_arg(desc, arg_p2p_bind_ipv6_port, false); + command_line::add_arg(desc, arg_p2p_bind_port, false); // DEPRECATED + command_line::add_arg(desc, arg_p2p_bind_port_ipv6, false); // DEPRECATED +- command_line::add_arg(desc, arg_p2p_use_ipv6); ++ command_line::add_arg(desc, arg_p2p_use_ipv6); // DEPRECATED ++ command_line::add_arg(desc, arg_p2p_ignore_ipv6); + command_line::add_arg(desc, arg_p2p_ignore_ipv4); + command_line::add_arg(desc, arg_p2p_external_port); + command_line::add_arg(desc, arg_p2p_allow_local_ip); +@@ -471,8 +472,13 @@ namespace nodetool + return false; + } + m_offline = command_line::get_arg(vm, cryptonote::arg_offline); +- m_use_ipv6 = command_line::get_arg(vm, arg_p2p_use_ipv6); ++ m_require_ipv6 = !command_line::get_arg(vm, arg_p2p_ignore_ipv6); + m_require_ipv4 = !command_line::get_arg(vm, arg_p2p_ignore_ipv4); ++ ++ // DEPRECATED --p2p-use-ipv6 ++ if (command_line::get_arg(vm, arg_p2p_use_ipv6)) ++ MWARNING("--p2p-use-ipv6 is now DEPRECATED and has no effect"); ++ + public_zone.m_notifier = cryptonote::levin::notify{ + public_zone.m_net_server.get_io_service(), public_zone.m_net_server.get_config_shared(), nullptr, epee::net_utils::zone::public_, pad_txs, m_payload_handler.get_core() + }; +@@ -1012,20 +1018,20 @@ namespace nodetool + std::string ipv6_port = ""; + zone.second.m_net_server.set_connection_filter(this); + MINFO("Binding (IPv4) on " << zone.second.m_bind_ipv4_address << ":" << zone.second.m_port_ipv4); +- if (!zone.second.m_bind_ipv6_address.empty() && m_use_ipv6) ++ if (!zone.second.m_bind_ipv6_address.empty() && m_require_ipv6) + { + ipv6_addr = zone.second.m_bind_ipv6_address; + ipv6_port = zone.second.m_port_ipv6; + MINFO("Binding (IPv6) on " << zone.second.m_bind_ipv6_address << ":" << zone.second.m_port_ipv6); + } +- res = zone.second.m_net_server.init_server(zone.second.m_port_ipv4, zone.second.m_bind_ipv4_address, ipv6_port, ipv6_addr, m_use_ipv6, m_require_ipv4, epee::net_utils::ssl_support_t::e_ssl_support_disabled); ++ res = zone.second.m_net_server.init_server(zone.second.m_port_ipv4, zone.second.m_bind_ipv4_address, ipv6_port, ipv6_addr, m_require_ipv6, m_require_ipv4, epee::net_utils::ssl_support_t::e_ssl_support_disabled); + CHECK_AND_ASSERT_MES(res, false, "Failed to bind server"); + } + } + + m_listening_port_ipv4 = public_zone.m_net_server.get_binded_port_ipv4(); + MLOG_GREEN(el::Level::Info, "Net service bound (IPv4) to " << public_zone.m_bind_ipv4_address << ":" << m_listening_port_ipv4); +- if (m_use_ipv6) ++ if (m_require_ipv6) + { + m_listening_port_ipv6 = public_zone.m_net_server.get_binded_port_ipv6(); + MLOG_GREEN(el::Level::Info, "Net service bound (IPv6) to " << public_zone.m_bind_ipv6_address << ":" << m_listening_port_ipv6); +@@ -1037,7 +1043,7 @@ namespace nodetool + if(m_igd == igd) + { + add_upnp_port_mapping_v4(m_listening_port_ipv4); +- if (m_use_ipv6) ++ if (m_require_ipv6) + { + add_upnp_port_mapping_v6(m_listening_port_ipv6); + } +diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp +index 0ce1346cc49d..642c8a790562 100644 +--- a/src/rpc/core_rpc_server.cpp ++++ b/src/rpc/core_rpc_server.cpp +@@ -399,7 +399,7 @@ namespace cryptonote + auto rng = [](size_t len, uint8_t *ptr){ return crypto::rand(len, ptr); }; + const bool inited = epee::http_server_impl_base::init( + rng, std::move(port), std::move(bind_ipv4_str), +- std::move(bind_ipv6_str), std::move(rpc_config->use_ipv6), std::move(rpc_config->require_ipv4), ++ std::move(bind_ipv6_str), std::move(rpc_config->require_ipv6), std::move(rpc_config->require_ipv4), + std::move(rpc_config->access_control_origins), std::move(http_login), std::move(rpc_config->ssl_options) + ); + +diff --git a/src/rpc/rpc_args.cpp b/src/rpc/rpc_args.cpp +index 4d0411b503d5..8ca7e5c7ad9f 100644 +--- a/src/rpc/rpc_args.cpp ++++ b/src/rpc/rpc_args.cpp +@@ -95,7 +95,8 @@ namespace cryptonote + , rpc_restricted_bind_ipv4_address({"rpc-restricted-bind-ipv4-address", rpc_args::tr("Specify IPv4 address to bind restricted RPC server"), "127.0.0.1"}) + , rpc_restricted_bind_ipv6_address({"rpc-restricted-bind-ipv6-address", rpc_args::tr("Specify IPv6 address to bind restricted RPC server"), "::1"}) + , rpc_restricted_bind_ip({"rpc-restricted-bind-ip", rpc_args::tr("DEPRECATED: replaced with --rpc-restricted-bind-ipv4-address"), ""}) +- , rpc_use_ipv6({"rpc-use-ipv6", rpc_args::tr("Allow IPv6 for RPC"), false}) ++ , rpc_use_ipv6({"rpc-use-ipv6", rpc_args::tr("DEPRECATED, ignored"), false}) ++ , rpc_ignore_ipv6({"rpc-ignore-ipv6", rpc_args::tr("Ignore unsuccessful IPv6 bind for RPC"), false}) + , rpc_ignore_ipv4({"rpc-ignore-ipv4", rpc_args::tr("Ignore unsuccessful IPv4 bind for RPC"), false}) + , rpc_login({"rpc-login", rpc_args::tr("Specify username[:password] required for RPC server"), "", true}) + , confirm_external_bind({"confirm-external-bind", rpc_args::tr("Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP")}) +@@ -121,7 +122,8 @@ namespace cryptonote + command_line::add_arg(desc, arg.rpc_restricted_bind_ipv4_address); + command_line::add_arg(desc, arg.rpc_restricted_bind_ipv6_address); + command_line::add_arg(desc, arg.rpc_restricted_bind_ip); // DEPRECATED +- command_line::add_arg(desc, arg.rpc_use_ipv6); ++ command_line::add_arg(desc, arg.rpc_use_ipv6); // DEPRECATED ++ command_line::add_arg(desc, arg.rpc_ignore_ipv6); + command_line::add_arg(desc, arg.rpc_ignore_ipv4); + command_line::add_arg(desc, arg.rpc_login); + command_line::add_arg(desc, arg.confirm_external_bind); +@@ -159,8 +161,13 @@ namespace cryptonote + if (config.restricted_bind_ipv4_address.empty()) + config.restricted_bind_ipv4_address = command_line::get_arg(vm, arg.rpc_restricted_bind_ip); + +- config.use_ipv6 = command_line::get_arg(vm, arg.rpc_use_ipv6); ++ config.require_ipv6 = !command_line::get_arg(vm, arg.rpc_ignore_ipv6); + config.require_ipv4 = !command_line::get_arg(vm, arg.rpc_ignore_ipv4); ++ ++ // DEPRECATED --rpc-use-ipv6 ++ if (command_line::get_arg(vm, arg.rpc_use_ipv6)) ++ MWARNING("--rpc-use-ipv6 is now DEPRECATED and has no effect"); ++ + config.disable_rpc_ban = command_line::get_arg(vm, arg.disable_rpc_ban); + if (!config.bind_ipv4_address.empty()) + { +diff --git a/src/rpc/rpc_args.h b/src/rpc/rpc_args.h +index 392e78703839..ea3cad8b3381 100644 +--- a/src/rpc/rpc_args.h ++++ b/src/rpc/rpc_args.h +@@ -57,7 +57,8 @@ namespace cryptonote + const command_line::arg_descriptor rpc_restricted_bind_ipv4_address; + const command_line::arg_descriptor rpc_restricted_bind_ipv6_address; + const command_line::arg_descriptor rpc_restricted_bind_ip; // DEPRECATED +- const command_line::arg_descriptor rpc_use_ipv6; ++ const command_line::arg_descriptor rpc_use_ipv6; // DEPRECATED ++ const command_line::arg_descriptor rpc_ignore_ipv6; + const command_line::arg_descriptor rpc_ignore_ipv4; + const command_line::arg_descriptor rpc_login; + const command_line::arg_descriptor confirm_external_bind; +@@ -87,7 +88,7 @@ namespace cryptonote + std::string bind_ipv6_address; + std::string restricted_bind_ipv4_address; + std::string restricted_bind_ipv6_address; +- bool use_ipv6; ++ bool require_ipv6; + bool require_ipv4; + std::vector access_control_origins; + boost::optional login; // currently `boost::none` if unspecified by user +diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp +index f5e3c4b4e861..616930421ec3 100644 +--- a/src/wallet/wallet_rpc_server.cpp ++++ b/src/wallet/wallet_rpc_server.cpp +@@ -281,7 +281,7 @@ namespace tools + auto rng = [](size_t len, uint8_t *ptr) { return crypto::rand(len, ptr); }; + return epee::http_server_impl_base::init( + rng, std::move(bind_port), std::move(rpc_config->bind_ipv4_address), +- std::move(rpc_config->bind_ipv6_address), std::move(rpc_config->use_ipv6), std::move(rpc_config->require_ipv4), ++ std::move(rpc_config->bind_ipv6_address), std::move(rpc_config->require_ipv6), std::move(rpc_config->require_ipv4), + std::move(rpc_config->access_control_origins), std::move(http_login), + std::move(rpc_config->ssl_options) + ); +diff --git a/utils/fish/monero-wallet-rpc.fish b/utils/fish/monero-wallet-rpc.fish +index c06f01b0352a..5633de534e0b 100644 +--- a/utils/fish/monero-wallet-rpc.fish ++++ b/utils/fish/monero-wallet-rpc.fish +@@ -38,7 +38,7 @@ complete -c monero-wallet-rpc -l rpc-bind-ipv4-address -r -d "Specify IPv4 addre + complete -c monero-wallet-rpc -l rpc-bind-ipv6-address -r -d "Specify IPv6 address to bind RPC server. Default: ::1" + complete -c monero-wallet-rpc -l rpc-restricted-bind-ipv4-address -r -d "Specify IPv4 address to bind restricted RPC server. Default: 127.0.0.1" + complete -c monero-wallet-rpc -l rpc-restricted-bind-ipv6-address -r -d "Specify IPv6 address to bind restricted RPC server. Default: ::1" +-complete -c monero-wallet-rpc -l rpc-use-ipv6 -d "Allow IPv6 for RPC" ++complete -c monero-wallet-rpc -l rpc-ignore-ipv6 -d "Ignore unsuccessful IPv6 bind for RPC" + complete -c monero-wallet-rpc -l rpc-ignore-ipv4 -d "Ignore unsuccessful IPv4 bind for RPC" + complete -c monero-wallet-rpc -l rpc-login -r -d "Specify username[:password] required for RPC server" + complete -c monero-wallet-rpc -l confirm-external-bind -d "Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP" +diff --git a/utils/fish/monerod.fish b/utils/fish/monerod.fish +index 9080d47b3636..2a0ff04628f0 100644 +--- a/utils/fish/monerod.fish ++++ b/utils/fish/monerod.fish +@@ -58,7 +58,7 @@ complete -c monerod -l p2p-bind-ipv4-address -r -d "Interface for p2p network pr + complete -c monerod -l p2p-bind-ipv6-address -r -d "Interface for p2p network protocol (IPv6). Default: ::" + complete -c monerod -l p2p-bind-ipv4-port -r -d "Port for p2p network protocol (IPv4). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" + complete -c monerod -l p2p-bind-ipv6-port -d "Port for p2p network protocol (IPv6). Default: 18080, 28080 if 'testnet', 38080 if 'stagenet'" +-complete -c monerod -l p2p-use-ipv6 -d "Enable IPv6 for p2p" ++complete -c monerod -l p2p-ignore-ipv6 -d "Ignore unsuccessful IPv6 bind for p2p" + complete -c monerod -l p2p-ignore-ipv4 -d "Ignore unsuccessful IPv4 bind for p2p" + complete -c monerod -l p2p-external-port -r -d "External port for p2p network protocol (if port forwarding used with NAT). Default: 0" + complete -c monerod -l allow-local-ip -d "Allow local ip add to peer list, mostly in debug purposes" +@@ -92,7 +92,7 @@ complete -c monerod -l rpc-bind-ipv4-address -r -d "Specify IPv4 address to bind + complete -c monerod -l rpc-bind-ipv6-address -r -d "Specify IPv6 address to bind RPC server. Default: ::1" + complete -c monerod -l rpc-restricted-bind-ipv4-address -r -d "Specify IPv4 address to bind restricted RPC server. Default: 127.0.0.1" + complete -c monerod -l rpc-restricted-bind-ipv6-address -r -d "Specify IPv6 address to bind restricted RPC server. Default: ::1" +-complete -c monerod -l rpc-use-ipv6 -d "Allow IPv6 for RPC" ++complete -c monerod -l rpc-ignore-ipv6 -d "Ignore unsuccessful IPv6 bind for RPC" + complete -c monerod -l rpc-ignore-ipv4 -d "Ignore unsuccessful IPv4 bind for RPC" + complete -c monerod -l rpc-login -d "Specify username[:password] required for RPC server" + complete -c monerod -l confirm-external-bind -d "Confirm rpc-bind-ipv4-address value is NOT a loopback (local) IP" -- cgit v1.2.3