Skip to content

Commit d35ef30

Browse files
authored
Use IPV6_HDRINCL on Linux(#563)
Instead of IP_HDRINCL in Socket:: set_header_included_v6.
1 parent 5c1f3b0 commit d35ef30

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/socket.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,9 @@ impl Socket {
16741674
setsockopt(
16751675
self.as_raw(),
16761676
sys::IPPROTO_IPV6,
1677+
#[cfg(target_os = "linux")]
1678+
sys::IPV6_HDRINCL,
1679+
#[cfg(not(target_os = "linux"))]
16771680
sys::IP_HDRINCL,
16781681
included as c_int,
16791682
)

src/sys/unix.rs

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ pub(crate) use libc::SO_OOBINLINE;
124124
// Used in `Socket`.
125125
#[cfg(not(target_os = "nto"))]
126126
pub(crate) use libc::ipv6_mreq as Ipv6Mreq;
127+
#[cfg(all(feature = "all", target_os = "linux"))]
128+
pub(crate) use libc::IPV6_HDRINCL;
127129
#[cfg(all(
128130
feature = "all",
129131
not(any(

0 commit comments

Comments
 (0)