mirror of
https://github.com/zeromq/libzmq.git
synced 2025-09-25 15:29:35 +02:00
Problem: Windows does not support IPV6_TCLASS
Solution: don't use it on Windows. There is a Windows-specific API for ToS, even IPv4 does not work and it's just a silent no-op on that platform.
This commit is contained in:
parent
4a24805f70
commit
33fcd2d6ca
12
src/ip.cpp
12
src/ip.cpp
@ -173,6 +173,8 @@ void zmq::set_ip_type_of_service (fd_t s_, int iptos)
|
||||
errno_assert (rc == 0);
|
||||
#endif
|
||||
|
||||
// Windows does not support IPV6_TCLASS
|
||||
#ifndef ZMQ_HAVE_WINDOWS
|
||||
rc = setsockopt(
|
||||
s_,
|
||||
IPPROTO_IPV6,
|
||||
@ -180,14 +182,8 @@ void zmq::set_ip_type_of_service (fd_t s_, int iptos)
|
||||
reinterpret_cast<const char*>(&iptos),
|
||||
sizeof(iptos));
|
||||
|
||||
// If IPv6 is not enabled ENOPROTOOPT will be returned on Windows and
|
||||
// Linux, and EINVAL on OSX
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
if (rc == SOCKET_ERROR) {
|
||||
const int last_error = WSAGetLastError();
|
||||
wsa_assert (last_error == WSAENOPROTOOPT);
|
||||
}
|
||||
#else
|
||||
// If IPv6 is not enabled ENOPROTOOPT will be returned on Linux and
|
||||
// EINVAL on OSX
|
||||
if (rc == -1) {
|
||||
errno_assert (errno == ENOPROTOOPT ||
|
||||
errno == EINVAL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user