From e27c4110d9c47d30fed4b940813c9c8b82a97fbd Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 1 May 2014 12:07:03 +0200 Subject: 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...) --- src/net.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/net.cpp') 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); } -- cgit v1.2.3