From 475d4ea7c54fb268a5780f3ddf3c5554c53fb665 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Tue, 15 Oct 2024 07:17:08 -0300 Subject: [PATCH] Fix: header_included_v6 is broken on BSD OSes #534 Broken since #518 - looks like BSD operating systems don't support IP_HDRINCL at the IPPROTO_IPV6 socket level like Linux and Windows; this is causing CI to fail. --- src/socket.rs | 24 ++++++++++++++++++++++-- tests/socket.rs | 12 +++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/socket.rs b/src/socket.rs index 8d517b47..3d9d44af 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -1682,7 +1682,17 @@ impl Socket { /// For more information about this option, see [`set_header_included`]. /// /// [`set_header_included`]: Socket::set_header_included - #[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))] + #[cfg(all( + feature = "all", + not(any( + target_os = "redox", + target_os = "espidf", + target_os = "openbsd", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "netbsd" + )) + ))] #[cfg_attr( docsrs, doc(cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))) @@ -1706,7 +1716,17 @@ impl Socket { any(target_os = "fuchsia", target_os = "illumos", target_os = "solaris"), allow(rustdoc::broken_intra_doc_links) )] - #[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))] + #[cfg(all( + feature = "all", + not(any( + target_os = "redox", + target_os = "espidf", + target_os = "openbsd", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "netbsd" + )) + ))] #[cfg_attr( docsrs, doc(cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))) diff --git a/tests/socket.rs b/tests/socket.rs index 2300f0ed..1526d6d5 100644 --- a/tests/socket.rs +++ b/tests/socket.rs @@ -1564,7 +1564,17 @@ fn header_included() { } #[test] -#[cfg(all(feature = "all", not(target_os = "redox")))] + #[cfg(all( + feature = "all", + not(any( + target_os = "redox", + target_os = "espidf", + target_os = "openbsd", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "netbsd" + )) + ))] fn header_included_ipv6() { let socket = match Socket::new(Domain::IPV6, Type::RAW, None) { Ok(socket) => socket,