Skip to content

Commit

Permalink
Don't remove the linux ipv6 original_dst test
Browse files Browse the repository at this point in the history
Signed-off-by: keithmattix <keithmattix@microsoft.com>
  • Loading branch information
keithmattix committed Sep 12, 2024
1 parent b4a47f4 commit 8976de5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,25 @@ fn original_dst() {
}
}

#[test]
#[cfg(all(
feature = "all",
any(target_os = "android", target_os = "fuchsia", target_os = "linux")
))]fn original_dst_ipv6() {
let socket = Socket::new(Domain::IPV6, Type::STREAM, None).unwrap();
match socket.original_dst_ipv6() {
Ok(_) => panic!("original_dst_ipv6 on non-redirected socket should fail"),
Err(err) => assert_eq!(err.raw_os_error(), Some(libc::ENOENT)),
}

// Not supported on IPv4 socket.
let socket = Socket::new(Domain::IPV4, Type::STREAM, None).unwrap();
match socket.original_dst_ipv6() {
Ok(_) => panic!("original_dst_ipv6 on non-redirected socket should fail"),
Err(err) => assert_eq!(err.raw_os_error(), Some(libc::EOPNOTSUPP)),
}
}

#[test]
#[cfg(all(feature = "all", target_os = "windows"))]
fn original_dst_ipv6() {
Expand Down

0 comments on commit 8976de5

Please sign in to comment.