File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1626,6 +1626,25 @@ fn original_dst() {
1626
1626
}
1627
1627
}
1628
1628
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
+
1629
1648
#[ test]
1630
1649
#[ cfg( all( feature = "all" , target_os = "windows" ) ) ]
1631
1650
fn original_dst_ipv6 ( ) {
You can’t perform that action at this time.
0 commit comments