Skip to content

Commit

Permalink
Enable ToS/TClass IP socket options on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
spencercw committed Dec 4, 2023
1 parent e984d94 commit d742537
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/2081.added.md
@@ -1 +1,2 @@
Added `IP_RECVTOS` and `IPV6_RECVTCLASS` socket options.
Enabled `IP_TOS` and `IPV6_TCLASS` socket options on Android.
4 changes: 2 additions & 2 deletions src/sys/socket/sockopt.rs
Expand Up @@ -388,7 +388,7 @@ sockopt_impl!(
libc::SO_PRIORITY,
libc::c_int
);
#[cfg(target_os = "linux")]
#[cfg(linux_android)]
#[cfg(feature = "net")]
sockopt_impl!(
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
Expand All @@ -400,7 +400,7 @@ sockopt_impl!(
libc::IP_TOS,
libc::c_int
);
#[cfg(target_os = "linux")]
#[cfg(linux_android)]
#[cfg(feature = "net")]
sockopt_impl!(
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
Expand Down
4 changes: 2 additions & 2 deletions test/sys/test_socket.rs
Expand Up @@ -2257,7 +2257,7 @@ pub fn test_recv_ipv6pktinfo() {
}
}

#[cfg(target_os = "linux")]
#[cfg(linux_android)]
#[test]
pub fn test_tos_ipv4() {
use nix::sys::socket::sockopt::{IpTos, Ipv4RecvTos};
Expand Down Expand Up @@ -2335,7 +2335,7 @@ pub fn test_tos_ipv4() {
}
}

#[cfg(target_os = "linux")]
#[cfg(linux_android)]
#[test]
pub fn test_tclass_ipv6() {
use nix::sys::socket::sockopt::{Ipv6RecvTClass, Ipv6TClass};
Expand Down

0 comments on commit d742537

Please sign in to comment.