Skip to content

Commit ea933b0

Browse files
author
Philip Kaufmann
committed
use "IPv6" and "IPv4" in strings as these are the official spellings and make ParseNetwork() in netbase.cpp case-insensitive
1 parent a6cd0b0 commit ea933b0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ bool AppInit2(int argc, char* argv[])
192192
" -timeout=<n> \t " + _("Specify connection timeout (in milliseconds)") + "\n" +
193193
" -proxy=<ip:port> \t " + _("Connect through socks proxy") + "\n" +
194194
" -socks=<n> \t " + _("Select the version of socks proxy to use (4 or 5, 5 is default)") + "\n" +
195-
" -noproxy=<net> \t " + _("Do not use proxy for connections to network net (ipv4 or ipv6)") + "\n" +
195+
" -noproxy=<net> \t " + _("Do not use proxy for connections to network <net> (IPv4 or IPv6)") + "\n" +
196196
" -dns \t " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" +
197197
" -proxydns \t " + _("Pass DNS requests to (SOCKS5) proxy") + "\n" +
198198
" -port=<port> \t\t " + _("Listen for connections on <port> (default: 8333 or testnet: 18333)") + "\n" +
@@ -201,7 +201,7 @@ bool AppInit2(int argc, char* argv[])
201201
" -connect=<ip> \t\t " + _("Connect only to the specified node") + "\n" +
202202
" -seednode=<ip> \t\t " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" +
203203
" -externalip=<ip> \t " + _("Specify your own public address") + "\n" +
204-
" -blocknet=<net> \t " + _("Do not connect to addresses in network net (ipv4, ipv6)") + "\n" +
204+
" -blocknet=<net> \t " + _("Do not connect to addresses in network <net> (IPv4 or IPv6)") + "\n" +
205205
" -discover \t " + _("Try to discover public IP address (default: 1)") + "\n" +
206206
" -irc \t " + _("Find peers using internet relay chat (default: 0)") + "\n" +
207207
" -listen \t " + _("Accept connections from outside (default: 1)") + "\n" +

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,15 +1796,15 @@ void static Discover()
17961796
struct sockaddr_in* s4 = (struct sockaddr_in*)(ifa->ifa_addr);
17971797
CNetAddr addr(s4->sin_addr);
17981798
if (AddLocal(addr, LOCAL_IF))
1799-
printf("ipv4 %s: %s\n", ifa->ifa_name, addr.ToString().c_str());
1799+
printf("IPv4 %s: %s\n", ifa->ifa_name, addr.ToString().c_str());
18001800
}
18011801
#ifdef USE_IPV6
18021802
else if (ifa->ifa_addr->sa_family == AF_INET6)
18031803
{
18041804
struct sockaddr_in6* s6 = (struct sockaddr_in6*)(ifa->ifa_addr);
18051805
CNetAddr addr(s6->sin6_addr);
18061806
if (AddLocal(addr, LOCAL_IF))
1807-
printf("ipv6 %s: %s\n", ifa->ifa_name, addr.ToString().c_str());
1807+
printf("IPv6 %s: %s\n", ifa->ifa_name, addr.ToString().c_str());
18081808
}
18091809
#endif
18101810
}

src/netbase.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#endif
1212

1313
#include "strlcpy.h"
14+
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
1415

1516
using namespace std;
1617

@@ -27,6 +28,7 @@ static bool vfNoProxy[NET_MAX] = {};
2728
static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
2829

2930
enum Network ParseNetwork(std::string net) {
31+
boost::to_lower(net);
3032
if (net == "ipv4") return NET_IPV4;
3133
if (net == "ipv6") return NET_IPV6;
3234
if (net == "tor") return NET_TOR;

0 commit comments

Comments
 (0)