From 242e087168ab511b08e331ff004a1d8e789e2e95 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Wed, 27 Apr 2022 14:21:24 +0200 Subject: [PATCH] Support Socket::(set_)recv_tos on Windows --- src/socket.rs | 2 -- src/sys/windows.rs | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/socket.rs b/src/socket.rs index 591a4b2d..aa3e1588 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -1400,7 +1400,6 @@ impl Socket { target_os = "netbsd", target_os = "redox", target_os = "solaris", - target_os = "windows", )))] pub fn set_recv_tos(&self, recv_tos: bool) -> io::Result<()> { let recv_tos = if recv_tos { 1 } else { 0 }; @@ -1426,7 +1425,6 @@ impl Socket { target_os = "netbsd", target_os = "redox", target_os = "solaris", - target_os = "windows", )))] pub fn recv_tos(&self) -> io::Result { unsafe { diff --git a/src/sys/windows.rs b/src/sys/windows.rs index fe9130fa..8b1d0c0f 100644 --- a/src/sys/windows.rs +++ b/src/sys/windows.rs @@ -69,9 +69,9 @@ pub(crate) use windows_sys::Win32::Networking::WinSock::{ IPV6_MULTICAST_HOPS, IPV6_MULTICAST_IF, IPV6_MULTICAST_LOOP, IPV6_UNICAST_HOPS, IPV6_V6ONLY, IP_ADD_MEMBERSHIP, IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, IP_MREQ as IpMreq, IP_MREQ_SOURCE as IpMreqSource, IP_MULTICAST_IF, IP_MULTICAST_LOOP, - IP_MULTICAST_TTL, IP_TOS, IP_TTL, MSG_OOB, MSG_PEEK, SO_BROADCAST, SO_ERROR, SO_KEEPALIVE, - SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_RCVTIMEO, SO_REUSEADDR, SO_SNDBUF, SO_SNDTIMEO, SO_TYPE, - TCP_NODELAY, + IP_MULTICAST_TTL, IP_RECVTOS, IP_TOS, IP_TTL, MSG_OOB, MSG_PEEK, SO_BROADCAST, SO_ERROR, + SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_RCVTIMEO, SO_REUSEADDR, SO_SNDBUF, + SO_SNDTIMEO, SO_TYPE, TCP_NODELAY, }; pub(crate) const IPPROTO_IP: c_int = windows_sys::Win32::Networking::WinSock::IPPROTO_IP as c_int; pub(crate) const SOL_SOCKET: c_int = windows_sys::Win32::Networking::WinSock::SOL_SOCKET as c_int;