Skip to content

Commit 8976de5

Browse files
committed
Don't remove the linux ipv6 original_dst test
Signed-off-by: keithmattix <[email protected]>
1 parent b4a47f4 commit 8976de5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/socket.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,25 @@ fn original_dst() {
16261626
}
16271627
}
16281628

1629+
#[test]
1630+
#[cfg(all(
1631+
feature = "all",
1632+
any(target_os = "android", target_os = "fuchsia", target_os = "linux")
1633+
))]fn original_dst_ipv6() {
1634+
let socket = Socket::new(Domain::IPV6, Type::STREAM, None).unwrap();
1635+
match socket.original_dst_ipv6() {
1636+
Ok(_) => panic!("original_dst_ipv6 on non-redirected socket should fail"),
1637+
Err(err) => assert_eq!(err.raw_os_error(), Some(libc::ENOENT)),
1638+
}
1639+
1640+
// Not supported on IPv4 socket.
1641+
let socket = Socket::new(Domain::IPV4, Type::STREAM, None).unwrap();
1642+
match socket.original_dst_ipv6() {
1643+
Ok(_) => panic!("original_dst_ipv6 on non-redirected socket should fail"),
1644+
Err(err) => assert_eq!(err.raw_os_error(), Some(libc::EOPNOTSUPP)),
1645+
}
1646+
}
1647+
16291648
#[test]
16301649
#[cfg(all(feature = "all", target_os = "windows"))]
16311650
fn original_dst_ipv6() {

0 commit comments

Comments
 (0)