summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-04-08 03:17:48 +0000
committerGitHub <noreply@github.com>2022-04-08 03:17:48 +0000
commit3b786fd71861d0a7fda5820ac9b987d0662a3981 (patch)
tree76bccac9377a994f266670c262aa71e71be3078c /src
parent131fdf1d3c31355311de76f1a37a42fc4411de7f (diff)
parenta4b5dfc059b11e7d463710bfcafa216eee770413 (diff)
downloadnix-3b786fd71861d0a7fda5820ac9b987d0662a3981.zip
Merge #1692
1692: Add IP_DONTFRAG and IPV6_DONTFRAG SockOpts r=rtzoeller a=junhochoi 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. Co-authored-by: Junho Choi <junho.choi@gmail.com>
Diffstat (limited to 'src')
-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!