summaryrefslogtreecommitdiff
path: root/src/sys/socket
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2021-09-06 10:24:40 -0700
committerConrad Meyer <cem@FreeBSD.org>2021-09-07 19:19:41 -0700
commit1ce595f526023bc007a9e0331b46ce95caeffc1f (patch)
treea1f986296e6f6cdc95911ae2daf0bd58286ddfb2 /src/sys/socket
parentccc1434960740dd0cb54e8141a22dd2ae920b956 (diff)
downloadnix-1ce595f526023bc007a9e0331b46ce95caeffc1f.zip
Add IP_TTL/IPV6_UNICAST_HOPS SockOpts
Test: `cargo test --test test test_ttl_opts`
Diffstat (limited to 'src/sys/socket')
-rw-r--r--src/sys/socket/sockopt.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs
index 17dd7568..00154fec 100644
--- a/src/sys/socket/sockopt.rs
+++ b/src/sys/socket/sockopt.rs
@@ -356,6 +356,10 @@ sockopt_impl!(Both, Ipv6V6Only, libc::IPPROTO_IPV6, libc::IPV6_V6ONLY, bool);
sockopt_impl!(Both, Ipv4RecvErr, libc::IPPROTO_IP, libc::IP_RECVERR, bool);
#[cfg(any(target_os = "android", target_os = "linux"))]
sockopt_impl!(Both, Ipv6RecvErr, libc::IPPROTO_IPV6, libc::IPV6_RECVERR, bool);
+#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))]
+sockopt_impl!(Both, Ipv4Ttl, libc::IPPROTO_IP, libc::IP_TTL, libc::c_int);
+#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))]
+sockopt_impl!(Both, Ipv6Ttl, libc::IPPROTO_IPV6, libc::IPV6_UNICAST_HOPS, libc::c_int);
#[cfg(any(target_os = "android", target_os = "linux"))]
#[derive(Copy, Clone, Debug)]