summaryrefslogtreecommitdiff
path: root/src/sys/socket
diff options
context:
space:
mode:
authorJunho Choi <junho.choi@gmail.com>2022-04-05 15:06:13 -0700
committerJunho Choi <junho.choi@gmail.com>2022-04-07 17:39:46 -0700
commita4b5dfc059b11e7d463710bfcafa216eee770413 (patch)
tree76bccac9377a994f266670c262aa71e71be3078c /src/sys/socket
parent131fdf1d3c31355311de76f1a37a42fc4411de7f (diff)
downloadnix-a4b5dfc059b11e7d463710bfcafa216eee770413.zip
Add IP_DONTFRAG and IPV6_DONTFRAG SockOpts
IP_DONTFRAG: iOS, macOS IPV6_DONTFRAG: android, iOS, linux and macOS Test: `cargo test --test test dontfrag_opts` Some CI tests running ENOPROTOOPT are disabled (qemu-based).
Diffstat (limited to 'src/sys/socket')
-rw-r--r--src/sys/socket/sockopt.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs
index c600391c..e80b09e7 100644
--- a/src/sys/socket/sockopt.rs
+++ b/src/sys/socket/sockopt.rs
@@ -615,6 +615,19 @@ sockopt_impl!(
sockopt_impl!(
/// Set the unicast hop limit for the socket.
Ipv6Ttl, Both, libc::IPPROTO_IPV6, libc::IPV6_UNICAST_HOPS, libc::c_int);
+#[cfg(any(target_os = "ios", target_os = "macos"))]
+sockopt_impl!(
+ /// Set "don't fragment packet" flag on the IP packet.
+ IpDontFrag, Both, libc::IPPROTO_IP, libc::IP_DONTFRAG, bool);
+#[cfg(any(
+ target_os = "android",
+ target_os = "ios",
+ target_os = "linux",
+ target_os = "macos",
+))]
+sockopt_impl!(
+ /// Set "don't fragment packet" flag on the IPv6 packet.
+ Ipv6DontFrag, Both, libc::IPPROTO_IPV6, libc::IPV6_DONTFRAG, bool);
#[allow(missing_docs)]
// Not documented by Linux!