Skip to content

Commit

Permalink
IPV6_RECVTCLASS not supported on freebsd
Browse files Browse the repository at this point in the history
  • Loading branch information
crisidev committed Jun 3, 2024
1 parent 4faed1b commit 342aa6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ sockopt_impl!(
sockopt_impl!(
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
/// Receive the traffic class associated with incoming packets.
Ipv6TRecvTClass,
Ipv6RecvTClass,
Both,
libc::IPPROTO_IPV6,
libc::IPV6_RECVTCLASS,
Expand Down
2 changes: 1 addition & 1 deletion test/sys/test_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,7 @@ pub fn test_ipv6_tclass_udp() {
None,
)
.unwrap();
setsockopt(&rsock, sockopt::Ipv6TRecvTClass, &true).unwrap();
setsockopt(&rsock, sockopt::Ipv6RecvTClass, &true).unwrap();
bind(rsock.as_raw_fd(), &sock_addr).unwrap();

let sbuf = [0u8; 2048];
Expand Down
10 changes: 5 additions & 5 deletions test/sys/test_sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ fn test_ipv4_recv_tos_opts() {
}

#[test]
#[cfg(any(linux_android, target_os = "freebsd"))]
#[cfg(linux_android)]
fn test_ipv6_recv_traffic_class_opts() {
let fd = socket(
AddressFamily::Inet6,
Expand All @@ -975,10 +975,10 @@ fn test_ipv6_recv_traffic_class_opts() {
SockProtocol::Tcp,
)
.unwrap();
setsockopt(&fd, sockopt::Ipv6TRecvTClass, &true).expect(
setsockopt(&fd, sockopt::Ipv6RecvTClass, &true).expect(
"setting IPV6_RECVTCLASS on an inet6 stream socket should succeed",
);
setsockopt(&fd, sockopt::Ipv6TRecvTClass, &false).expect(
setsockopt(&fd, sockopt::Ipv6RecvTClass, &false).expect(
"unsetting IPV6_RECVTCLASS on an inet6 stream socket should succeed",
);
let fdd = socket(
Expand All @@ -988,10 +988,10 @@ fn test_ipv6_recv_traffic_class_opts() {
None,
)
.unwrap();
setsockopt(&fdd, sockopt::Ipv6TRecvTClass, &true).expect(
setsockopt(&fdd, sockopt::Ipv6RecvTClass, &true).expect(
"setting IPV6_RECVTCLASS on an inet6 datagram socket should succeed",
);
setsockopt(&fdd, sockopt::Ipv6TRecvTClass, &false).expect(
setsockopt(&fdd, sockopt::Ipv6RecvTClass, &false).expect(
"unsetting IPV6_RECVTCLASS on an inet6 datagram socket should succeed",
);
}

0 comments on commit 342aa6b

Please sign in to comment.