Skip to content

Commit

Permalink
feat: add socket option IP_TOS/IPV6_TCLASS on Android/FreeBSD (#2464)
Browse files Browse the repository at this point in the history
* feat: add socket option IP_TOS/IPV6_TCLASS on Android/FreeBSD

* chore: changelog entry[skip ci]
  • Loading branch information
SteveLauC committed Jul 22, 2024
1 parent 50e4283 commit 5940300
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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

0 comments on commit 5940300

Please sign in to comment.