Skip to content

Commit ba422c8

Browse files
committed
Linux has defined IPV6_HDRINCL that is a different number than IP_HDRINCL. This patch adds a configuration that alters the value to set in set_header_included_v6()
1 parent 5c1f3b0 commit ba422c8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/socket.rs

Lines changed: 3 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ pub(crate) use libc::IPV6_RECVHOPLIMIT;
157157
pub(crate) use libc::IPV6_RECVTCLASS;
158158
#[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))]
159159
pub(crate) use libc::IP_HDRINCL;
160+
#[cfg(all(feature = "all", target_os = "linux"))]
161+
pub(crate) use libc::IPV6_HDRINCL;
160162
#[cfg(not(any(
161163
target_os = "aix",
162164
target_os = "dragonfly",

0 commit comments

Comments
 (0)