mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-19 17:55:37 +00:00
Hack around broken macOS ECN ABI
This commit is contained in:
committed by
Dirkjan Ochtman
parent
3c1e0df5d0
commit
f55dbaf8d0
@@ -158,7 +158,16 @@ impl super::UdpExt for UdpSocket {
|
||||
cmsg::decode::<u8>(cmsg)
|
||||
},
|
||||
(libc::IPPROTO_IPV6, libc::IPV6_TCLASS) => unsafe {
|
||||
cmsg::decode::<libc::c_int>(cmsg) as u8
|
||||
// Temporary hack around broken macos ABI. Remove once upstream fixes it.
|
||||
// https://bugreport.apple.com/web/?problemID=48761855
|
||||
if cfg!(target_os = "macos")
|
||||
&& cmsg.cmsg_len as usize
|
||||
== libc::CMSG_LEN(mem::size_of::<u8>() as _) as usize
|
||||
{
|
||||
cmsg::decode::<u8>(cmsg)
|
||||
} else {
|
||||
cmsg::decode::<libc::c_int>(cmsg) as u8
|
||||
}
|
||||
},
|
||||
_ => 0,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user