aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
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);
}