From 342aa6bd3e2200da7bf8a20cbf4944fb2ad36b82 Mon Sep 17 00:00:00 2001 From: Bigo <1781140+crisidev@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:55:09 +0100 Subject: [PATCH] IPV6_RECVTCLASS not supported on freebsd --- src/sys/socket/sockopt.rs | 2 +- test/sys/test_socket.rs | 2 +- test/sys/test_sockopt.rs | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index 82d62a49e6..b154eafd88 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -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, diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs index 9a57fdb29a..4c5edbc178 100644 --- a/test/sys/test_socket.rs +++ b/test/sys/test_socket.rs @@ -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]; diff --git a/test/sys/test_sockopt.rs b/test/sys/test_sockopt.rs index d9b499063c..399e27dac0 100644 --- a/test/sys/test_sockopt.rs +++ b/test/sys/test_sockopt.rs @@ -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, @@ -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( @@ -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", ); }