Commit 294bdb4e authored by Constantin Rack's avatar Constantin Rack Committed by GitHub

Merge pull request #2231 from bluca/windows_ipv6_tos

Problem: Windows does not support IPV6_TCLASS
parents 4a24805f 33fcd2d6
...@@ -173,6 +173,8 @@ void zmq::set_ip_type_of_service (fd_t s_, int iptos) ...@@ -173,6 +173,8 @@ void zmq::set_ip_type_of_service (fd_t s_, int iptos)
errno_assert (rc == 0); errno_assert (rc == 0);
#endif #endif
// Windows does not support IPV6_TCLASS
#ifndef ZMQ_HAVE_WINDOWS
rc = setsockopt( rc = setsockopt(
s_, s_,
IPPROTO_IPV6, IPPROTO_IPV6,
...@@ -180,14 +182,8 @@ void zmq::set_ip_type_of_service (fd_t s_, int iptos) ...@@ -180,14 +182,8 @@ void zmq::set_ip_type_of_service (fd_t s_, int iptos)
reinterpret_cast<const char*>(&iptos), reinterpret_cast<const char*>(&iptos),
sizeof(iptos)); sizeof(iptos));
// If IPv6 is not enabled ENOPROTOOPT will be returned on Windows and // If IPv6 is not enabled ENOPROTOOPT will be returned on Linux and
// Linux, and EINVAL on OSX // EINVAL on OSX
#ifdef ZMQ_HAVE_WINDOWS
if (rc == SOCKET_ERROR) {
const int last_error = WSAGetLastError();
wsa_assert (last_error == WSAENOPROTOOPT);
}
#else
if (rc == -1) { if (rc == -1) {
errno_assert (errno == ENOPROTOOPT || errno_assert (errno == ENOPROTOOPT ||
errno == EINVAL); errno == EINVAL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment