diff --git a/src/socket.rs b/src/socket.rs index 1bed96f5..7f2a1edf 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -1674,6 +1674,9 @@ impl Socket { setsockopt( self.as_raw(), sys::IPPROTO_IPV6, + #[cfg(target_os = "linux")] + sys::IPV6_HDRINCL, + #[cfg(not(target_os = "linux"))] sys::IP_HDRINCL, included as c_int, ) diff --git a/src/sys/unix.rs b/src/sys/unix.rs index 37d0c3a6..8e24f4e5 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -124,6 +124,8 @@ pub(crate) use libc::SO_OOBINLINE; // Used in `Socket`. #[cfg(not(target_os = "nto"))] pub(crate) use libc::ipv6_mreq as Ipv6Mreq; +#[cfg(all(feature = "all", target_os = "linux"))] +pub(crate) use libc::IPV6_HDRINCL; #[cfg(all( feature = "all", not(any(