Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add socket option IP_TOS/IPV6_TCLASS on Android/FreeBSD #2464

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2464.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add socket option IP_TOS (nix::sys::socket::sockopt::IpTos) IPV6_TCLASS (nix::sys::socket::sockopt::Ipv6TClass) on Android/FreeBSD
4 changes: 2 additions & 2 deletions src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ sockopt_impl!(
libc::SO_PRIORITY,
libc::c_int
);
#[cfg(target_os = "linux")]
#[cfg(any(linux_android, target_os = "freebsd"))]
#[cfg(feature = "net")]
sockopt_impl!(
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
Expand All @@ -414,7 +414,7 @@ sockopt_impl!(
libc::IP_TOS,
libc::c_int
);
#[cfg(target_os = "linux")]
#[cfg(any(linux_android, target_os = "freebsd"))]
#[cfg(feature = "net")]
sockopt_impl!(
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
Expand Down
4 changes: 2 additions & 2 deletions test/sys/test_sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ fn test_so_priority() {
}

#[test]
#[cfg(target_os = "linux")]
#[cfg(any(linux_android, target_os = "freebsd"))]
fn test_ip_tos() {
let fd = socket(
AddressFamily::Inet,
Expand All @@ -484,7 +484,7 @@ fn test_ip_tos() {
}

#[test]
#[cfg(target_os = "linux")]
#[cfg(any(linux_android, target_os = "freebsd"))]
// Disable the test under emulation because it fails in Cirrus-CI. Lack
// of QEMU support is suspected.
#[cfg_attr(qemu, ignore)]
Expand Down