aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-05-01 12:07:03 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-05-01 12:15:36 +0200
commite27c4110d9c47d30fed4b940813c9c8b82a97fbd (patch)
tree288e02bd1addb587a17cfc2c350e74d5545bb56f /src/net.cpp
parent426dc16f7b74d5dc91a947bb22acb7a3a414bb8f (diff)
Remove build-time no-IPv6 setting
The year is 2014. All supported operating systems have IPv6 support, most certainly at build time (this doesn't mean that IPv6 is configured, of course). If noone is exercising the functionality to disable it, that means it doesn't get tested, and IMO it's better to get rid of it. (it's also not used consistently in RPC/boost and Net code...)
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/net.cpp b/src/net.cpp
index a0208c9605..a73ff73ebd 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -917,11 +917,7 @@ void ThreadSocketHandler()
BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket)
if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv))
{
-#ifdef USE_IPV6
struct sockaddr_storage sockaddr;
-#else
- struct sockaddr sockaddr;
-#endif
socklen_t len = sizeof(sockaddr);
SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len);
CAddress addr;
@@ -1582,11 +1578,7 @@ bool BindListenPort(const CService &addrBind, string& strError)
int nOne = 1;
// Create socket for listening for incoming connections
-#ifdef USE_IPV6
struct sockaddr_storage sockaddr;
-#else
- struct sockaddr sockaddr;
-#endif
socklen_t len = sizeof(sockaddr);
if (!addrBind.GetSockAddr((struct sockaddr*)&sockaddr, &len))
{
@@ -1627,7 +1619,6 @@ bool BindListenPort(const CService &addrBind, string& strError)
return false;
}
-#ifdef USE_IPV6
// some systems don't have IPV6_V6ONLY but are always v6only; others do have the option
// and enable it by default or not. Try to enable it, if possible.
if (addrBind.IsIPv6()) {
@@ -1645,7 +1636,6 @@ bool BindListenPort(const CService &addrBind, string& strError)
setsockopt(hListenSocket, IPPROTO_IPV6, nParameterId, (const char*)&nProtLevel, sizeof(int));
#endif
}
-#endif
if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR)
{
@@ -1712,7 +1702,6 @@ void static Discover(boost::thread_group& threadGroup)
if (AddLocal(addr, LOCAL_IF))
LogPrintf("IPv4 %s: %s\n", ifa->ifa_name, addr.ToString());
}
-#ifdef USE_IPV6
else if (ifa->ifa_addr->sa_family == AF_INET6)
{
struct sockaddr_in6* s6 = (struct sockaddr_in6*)(ifa->ifa_addr);
@@ -1720,7 +1709,6 @@ void static Discover(boost::thread_group& threadGroup)
if (AddLocal(addr, LOCAL_IF))
LogPrintf("IPv6 %s: %s\n", ifa->ifa_name, addr.ToString());
}
-#endif
}
freeifaddrs(myaddrs);
}