Skip to content

Commit

Permalink
Fix: header_included_v6 is broken on BSD OSes rust-lang#534
Browse files Browse the repository at this point in the history
Broken since rust-lang#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.
  • Loading branch information
jjnicola committed Oct 15, 2024
1 parent 3a93893 commit 475d4ea
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
24 changes: 22 additions & 2 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")))))
Expand All @@ -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")))))
Expand Down
12 changes: 11 additions & 1 deletion tests/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 475d4ea

Please sign in to comment.