From 1ce595f526023bc007a9e0331b46ce95caeffc1f Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Mon, 6 Sep 2021 10:24:40 -0700 Subject: Add IP_TTL/IPV6_UNICAST_HOPS SockOpts Test: `cargo test --test test test_ttl_opts` --- src/sys/socket/sockopt.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sys/socket') 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)] -- cgit v1.2.3