1 quinn-udp needs illumos/illumos support. Firefox uses this for the new
3 --- gecko-dev-fa55b33a4b56f392bc5a0c7616e0dfe055112cb5/third_party/rust/quinn-udp/.cargo-checksum.json.old 2024-07-27 12:06:31.655202997 -0400
4 +++ gecko-dev-fa55b33a4b56f392bc5a0c7616e0dfe055112cb5/third_party/rust/quinn-udp/.cargo-checksum.json 2024-07-27 12:06:59.594477839 -0400
6 -{"files":{"Cargo.toml":"bf505df0c4f9254fa37950bad863cb838a8a7d2be4c8d3f28bdd679f945ef8cf","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"4b2d0aca6789fa39e03d6738e869ea0988cceba210ca34ebb59c15c463e93a04","benches/throughput.rs":"8f00856e6c6f1dd8c7dd6c8a22b36c6f42dfa4d709edf3348de75d32e22c71fb","src/cmsg/mod.rs":"23d898d72c5aabda93d987526fdd78231bb5907bce2b6b2d292a56bdfd977f86","src/cmsg/unix.rs":"1a4089e5e61536a3c370c6b1bc891036ec2d0e2e78105fbb5b8227705e905d34","src/cmsg/windows.rs":"6fb936ec4a283efc5796872e777441e3039c40589073865644a8ef7936af4f4b","src/fallback.rs":"7fe9666b0bf508d1b5ec0b3690bb7add94c8f213cb51a263c9959e22a5094ad0","src/lib.rs":"72be7f797a3a11e452e7764fadadebc43ae7f9c14ba7fa80aedbbee71aa889c7","src/unix.rs":"fbc9a6ab281cc66500e6afa8b9ebdee73ca281ca14732e8076d9b1f10f431de7","src/windows.rs":"e741a7bdd86d7fcb856db855f9308af01e69387c00e6a726d322f1f4d3046b74","tests/tests.rs":"51bcf6d3f1a3fcf7d481ae966eb679f88341886ff4277f5747df3340ed709d09"},"package":"8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285"}
7 \ No newline at end of file
8 +{"files":{"Cargo.toml":"bf505df0c4f9254fa37950bad863cb838a8a7d2be4c8d3f28bdd679f945ef8cf","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"4b2d0aca6789fa39e03d6738e869ea0988cceba210ca34ebb59c15c463e93a04","benches/throughput.rs":"8f00856e6c6f1dd8c7dd6c8a22b36c6f42dfa4d709edf3348de75d32e22c71fb","src/cmsg/mod.rs":"23d898d72c5aabda93d987526fdd78231bb5907bce2b6b2d292a56bdfd977f86","src/cmsg/unix.rs":"1a4089e5e61536a3c370c6b1bc891036ec2d0e2e78105fbb5b8227705e905d34","src/cmsg/windows.rs":"6fb936ec4a283efc5796872e777441e3039c40589073865644a8ef7936af4f4b","src/fallback.rs":"7fe9666b0bf508d1b5ec0b3690bb7add94c8f213cb51a263c9959e22a5094ad0","src/lib.rs":"72be7f797a3a11e452e7764fadadebc43ae7f9c14ba7fa80aedbbee71aa889c7","src/unix.rs":"9417f7d5c8b1019a21d4aabf9bbbcad343ab66c1de4d20f4379efe515a37d1ea","src/windows.rs":"e741a7bdd86d7fcb856db855f9308af01e69387c00e6a726d322f1f4d3046b74","tests/tests.rs":"51bcf6d3f1a3fcf7d481ae966eb679f88341886ff4277f5747df3340ed709d09"},"package":"8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285"}
10 --- gecko-dev-fa55b33a4b56f392bc5a0c7616e0dfe055112cb5/third_party/rust/quinn-udp/src/unix.rs.~1~ 2024-07-26 11:08:57.000000000 -0400
11 +++ gecko-dev-fa55b33a4b56f392bc5a0c7616e0dfe055112cb5/third_party/rust/quinn-udp/src/unix.rs 2024-07-28 22:01:23.213328142 -0400
13 -#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "openbsd")))]
14 +#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "openbsd", target_os = "illumos")))]
17 io::{self, IoSliceMut},
19 // Defined in netinet6/in6.h on OpenBSD, this is not yet exported by the libc crate
20 // directly. See https://github.com/rust-lang/libc/issues/3704 for when we might be able to
21 // rely on this from the libc crate.
22 -#[cfg(any(target_os = "openbsd", target_os = "netbsd"))]
23 +#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "illumos"))]
24 const IPV6_DONTFRAG: libc::c_int = 62;
25 -#[cfg(not(any(target_os = "openbsd", target_os = "netbsd")))]
26 +#[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "illumos")))]
27 const IPV6_DONTFRAG: libc::c_int = libc::IPV6_DONTFRAG;
29 +// Add missing IP constants from /usr/include/netinet/in.h for illumos
30 +#[cfg(any(target_os = "illumos"))]
31 +const IPV6_RECVTCLASS: libc::c_int = 25;
33 +#[cfg(any(target_os = "illumos"))]
34 +const IP_TOS: libc::c_int = 3;
36 +#[cfg(any(target_os = "illumos"))]
37 +const IPV6_TCLASS: libc::c_int = 38;
39 +#[cfg(any(target_os = "illumos"))]
40 +#[derive(Copy, Clone)]
42 + ipi6_addr: libc::in6_addr,
43 + ipi6_ifindex: libc::c_uint,
46 +#[cfg(any(target_os = "illumos"))]
47 +const IPV6_PKTINFO: libc::c_int = 11;
49 #[cfg(target_os = "freebsd")]
50 type IpTosTy = libc::c_uchar;
51 #[cfg(not(any(target_os = "freebsd", target_os = "netbsd")))]
53 || cfg!(target_os = "android")
55 cmsg_platform_space +=
56 - unsafe { libc::CMSG_SPACE(mem::size_of::<libc::in6_pktinfo>() as _) as usize };
63 // mac and ios do not support IP_RECVTOS on dual-stack sockets :(
64 // older macos versions also don't have the flag and will error out if we don't ignore it
65 - #[cfg(not(any(target_os = "openbsd", target_os = "netbsd")))]
66 + #[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "illumos")))]
67 if is_ipv4 || !io.only_v6()? {
68 #[allow(unused_variables)]
69 if let Err(err) = set_socket_option(&*io, libc::IPPROTO_IP, libc::IP_RECVTOS, OPTION_ON)
71 target_os = "openbsd",
76 + target_os = "illumos"
78 // IP_RECVDSTADDR == IP_SENDSRCADDR on FreeBSD
79 - // macOS uses only IP_RECVDSTADDR, no IP_SENDSRCADDR on macOS
80 + // macOS uses only IP_RECVDSTADDR, no IP_SENDSRCADDR on macOS/Illumos
81 // macOS also supports IP_PKTINFO
85 // Options standardized in RFC 3542
87 set_socket_option(&*io, libc::IPPROTO_IPV6, libc::IPV6_RECVPKTINFO, OPTION_ON)?;
88 - set_socket_option(&*io, libc::IPPROTO_IPV6, libc::IPV6_RECVTCLASS, OPTION_ON)?;
89 + set_socket_option(&*io, libc::IPPROTO_IPV6,IPV6_RECVTCLASS, OPTION_ON)?;
90 // Linux's IP_PMTUDISC_PROBE allows us to operate under interface MTU rather than the
91 // kernel's path MTU guess, but actually disabling fragmentation requires this too. See
92 // __ip6_append_data in ip6_output.c.
97 -#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "openbsd")))]
98 +#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "openbsd", target_os = "illumos")))]
99 fn recv(io: SockRef<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta]) -> io::Result<usize> {
100 let mut names = [MaybeUninit::<libc::sockaddr_storage>::uninit(); BATCH_SIZE];
101 let mut ctrls = [cmsg::Aligned(MaybeUninit::<[u8; CMSG_LEN]>::uninit()); BATCH_SIZE];
103 Ok(msg_count as usize)
106 -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "openbsd"))]
107 +#[cfg(any(target_os = "macos", target_os = "ios", target_os = "openbsd", target_os = "illumos"))]
108 fn recv(io: SockRef<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta]) -> io::Result<usize> {
109 let mut name = MaybeUninit::<libc::sockaddr_storage>::uninit();
110 let mut ctrl = cmsg::Aligned(MaybeUninit::<[u8; CMSG_LEN]>::uninit());
113 /// It uses [`libc::syscall`] instead of [`libc::recvmmsg`]
114 /// to avoid linking error on systems where libc does not contain `recvmmsg`.
115 -#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "openbsd")))]
116 +#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "openbsd", target_os = "illumos")))]
117 unsafe fn recvmmsg_with_fallback(
119 msgvec: *mut libc::mmsghdr,
121 /// Fallback implementation of `recvmmsg` using `recvmsg`
122 /// for systems which do not support `recvmmsg`
123 /// such as Linux <2.6.33.
124 -#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "openbsd")))]
125 +#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "openbsd", target_os = "illumos")))]
126 unsafe fn recvmmsg_fallback(
128 msgvec: *mut libc::mmsghdr,
129 @@ -541,11 +562,11 @@
131 #[cfg(not(target_os = "netbsd"))]
133 - encoder.push(libc::IPPROTO_IP, libc::IP_TOS, ecn as IpTosTy);
134 + encoder.push(libc::IPPROTO_IP, IP_TOS, ecn as IpTosTy);
138 - encoder.push(libc::IPPROTO_IPV6, libc::IPV6_TCLASS, ecn);
139 + encoder.push(libc::IPPROTO_IPV6, IPV6_TCLASS, ecn);
142 if let Some(segment_size) = transmit.segment_size {
144 target_os = "netbsd",
147 + target_os = "illumos",
151 @@ -583,13 +605,13 @@
155 - let pktinfo = libc::in6_pktinfo {
156 + let pktinfo = in6_pktinfo {
158 ipi6_addr: libc::in6_addr {
159 s6_addr: v6.octets(),
162 - encoder.push(libc::IPPROTO_IPV6, libc::IPV6_PKTINFO, pktinfo);
163 + encoder.push(libc::IPPROTO_IPV6, IPV6_PKTINFO, pktinfo);
167 @@ -626,15 +648,15 @@
168 let cmsg_iter = unsafe { cmsg::Iter::new(hdr) };
169 for cmsg in cmsg_iter {
170 match (cmsg.cmsg_level, cmsg.cmsg_type) {
171 - (libc::IPPROTO_IP, libc::IP_TOS) => unsafe {
172 + (libc::IPPROTO_IP, IP_TOS) => unsafe {
173 ecn_bits = cmsg::decode::<u8, libc::cmsghdr>(cmsg);
175 // FreeBSD uses IP_RECVTOS here, and we can be liberal because cmsgs are opt-in.
176 - #[cfg(not(any(target_os = "openbsd", target_os = "netbsd")))]
177 + #[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "illumos")))]
178 (libc::IPPROTO_IP, libc::IP_RECVTOS) => unsafe {
179 ecn_bits = cmsg::decode::<u8, libc::cmsghdr>(cmsg);
181 - (libc::IPPROTO_IPV6, libc::IPV6_TCLASS) => unsafe {
182 + (libc::IPPROTO_IPV6, IPV6_TCLASS) => unsafe {
183 // Temporary hack around broken macos ABI. Remove once upstream fixes it.
184 // https://bugreport.apple.com/web/?problemID=48761855
185 #[allow(clippy::unnecessary_cast)] // cmsg.cmsg_len defined as size_t
187 let in_addr = unsafe { cmsg::decode::<libc::in_addr, libc::cmsghdr>(cmsg) };
188 dst_ip = Some(IpAddr::V4(Ipv4Addr::from(in_addr.s_addr.to_ne_bytes())));
190 - (libc::IPPROTO_IPV6, libc::IPV6_PKTINFO) => {
191 - let pktinfo = unsafe { cmsg::decode::<libc::in6_pktinfo, libc::cmsghdr>(cmsg) };
192 + (libc::IPPROTO_IPV6, IPV6_PKTINFO) => {
193 + let pktinfo = unsafe { cmsg::decode::<in6_pktinfo, libc::cmsghdr>(cmsg) };
194 dst_ip = Some(IpAddr::V6(Ipv6Addr::from(pktinfo.ipi6_addr.s6_addr)));
196 #[cfg(target_os = "linux")]