Index: rust-quinn-udp-0.4.1/src/unix.rs
===================================================================
--- rust-quinn-udp-0.4.1.orig/src/unix.rs
+++ rust-quinn-udp-0.4.1/src/unix.rs
@@ -73,7 +73,9 @@ impl Default for UdpSocketState {
 
 fn init(io: SockRef<'_>) -> io::Result<()> {
     let mut cmsg_platform_space = 0;
-    if cfg!(target_os = "linux") || cfg!(target_os = "freebsd") || cfg!(target_os = "macos") {
+
+    #[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))]
+    {
         cmsg_platform_space +=
             unsafe { libc::CMSG_SPACE(mem::size_of::<libc::in6_pktinfo>() as _) as usize };
     }
@@ -95,6 +97,7 @@ fn init(io: SockRef<'_>) -> io::Result<(
 
     // mac and ios do not support IP_RECVTOS on dual-stack sockets :(
     // older macos versions also don't have the flag and will error out if we don't ignore it
+    #[cfg(not(target_os = "hurd"))]
     if is_ipv4 || !io.only_v6()? {
         if let Err(err) = set_socket_option(&*io, libc::IPPROTO_IP, libc::IP_RECVTOS, OPTION_ON) {
             tracing::debug!("Ignoring error setting IP_RECVTOS on socket: {err:?}",);
@@ -323,7 +326,7 @@ unsafe fn sendmmsg_with_fallback(
 ) -> libc::c_int {
     let flags = 0;
 
-    #[cfg(not(target_os = "freebsd"))]
+    #[cfg(not(any(target_os = "freebsd", target_os = "hurd")))]
     {
         let ret = libc::syscall(libc::SYS_sendmmsg, sockfd, msgvec, vlen, flags) as libc::c_int;
         if ret != -1 {
@@ -341,13 +344,17 @@ unsafe fn sendmmsg_with_fallback(
         }
     }
 
-    let e = io::Error::last_os_error();
-    match e.raw_os_error() {
-        Some(libc::ENOSYS) => {
-            // Fallback to `sendmsg`.
-            sendmmsg_fallback(sockfd, msgvec, vlen)
-        }
-        _ => -1,
+    if cfg!(target_os = "hurd") {
+	sendmmsg_fallback(sockfd, msgvec, vlen)
+    } else {
+	let e = io::Error::last_os_error();
+	match e.raw_os_error() {
+	    Some(libc::ENOSYS) => {
+		// Fallback to `sendmsg`.
+		sendmmsg_fallback(sockfd, msgvec, vlen)
+	    }
+	    _ => -1,
+	}
     }
 }
 
@@ -451,7 +458,7 @@ unsafe fn recvmmsg_with_fallback(
     let flags = 0;
     let timeout = ptr::null_mut::<libc::timespec>();
 
-    #[cfg(not(target_os = "freebsd"))]
+    #[cfg(not(any(target_os = "freebsd", target_os = "hurd")))]
     {
         let ret =
             libc::syscall(libc::SYS_recvmmsg, sockfd, msgvec, vlen, flags, timeout) as libc::c_int;
@@ -470,13 +477,17 @@ unsafe fn recvmmsg_with_fallback(
         }
     }
 
-    let e = io::Error::last_os_error();
-    match e.raw_os_error() {
-        Some(libc::ENOSYS) => {
-            // Fallback to `recvmsg`.
-            recvmmsg_fallback(sockfd, msgvec, vlen)
-        }
-        _ => -1,
+    if cfg!(target_os = "hurd") {
+	recvmmsg_fallback(sockfd, msgvec, vlen)
+    } else {
+	let e = io::Error::last_os_error();
+	match e.raw_os_error() {
+	    Some(libc::ENOSYS) => {
+		// Fallback to `recvmsg`.
+		recvmmsg_fallback(sockfd, msgvec, vlen)
+	    }
+	    _ => -1,
+	}
     }
 }
 
@@ -582,13 +593,16 @@ fn prepare_msg(
                 }
             }
             IpAddr::V6(v6) => {
-                let pktinfo = libc::in6_pktinfo {
-                    ipi6_ifindex: 0,
-                    ipi6_addr: libc::in6_addr {
-                        s6_addr: v6.octets(),
-                    },
-                };
-                encoder.push(libc::IPPROTO_IPV6, libc::IPV6_PKTINFO, pktinfo);
+                #[cfg(not(target_os = "hurd"))]
+		{
+		    let pktinfo = libc::in6_pktinfo {
+			ipi6_ifindex: 0,
+			ipi6_addr: libc::in6_addr {
+			    s6_addr: v6.octets(),
+			},
+		    };
+		    encoder.push(libc::IPPROTO_IPV6, libc::IPV6_PKTINFO, pktinfo);
+		}
             }
         }
     }
@@ -626,7 +640,11 @@ fn decode_recv(
     for cmsg in cmsg_iter {
         match (cmsg.cmsg_level, cmsg.cmsg_type) {
             // FreeBSD uses IP_RECVTOS here, and we can be liberal because cmsgs are opt-in.
-            (libc::IPPROTO_IP, libc::IP_TOS) | (libc::IPPROTO_IP, libc::IP_RECVTOS) => unsafe {
+            (libc::IPPROTO_IP, libc::IP_TOS) => unsafe {
+                ecn_bits = cmsg::decode::<u8>(cmsg);
+            },
+            #[cfg(not(target_os = "hurd"))]
+            (libc::IPPROTO_IP, libc::IP_RECVTOS) => unsafe {
                 ecn_bits = cmsg::decode::<u8>(cmsg);
             },
             (libc::IPPROTO_IPV6, libc::IPV6_TCLASS) => unsafe {
@@ -653,6 +671,7 @@ fn decode_recv(
                 let in_addr = unsafe { cmsg::decode::<libc::in_addr>(cmsg) };
                 dst_ip = Some(IpAddr::V4(Ipv4Addr::from(in_addr.s_addr.to_ne_bytes())));
             }
+            #[cfg(not(target_os = "hurd"))]
             (libc::IPPROTO_IPV6, libc::IPV6_PKTINFO) => {
                 let pktinfo = unsafe { cmsg::decode::<libc::in6_pktinfo>(cmsg) };
                 dst_ip = Some(IpAddr::V6(Ipv6Addr::from(pktinfo.ipi6_addr.s6_addr)));
