File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ fn test_tcp_congestion() {
283283
284284#[ test]
285285#[ cfg( target_os = "freebsd" ) ]
286- fn test_tcp_function_blk ( ) {
286+ fn test_tcp_function_blk_alias ( ) {
287287 use std:: ffi:: CStr ;
288288
289289 let fd = socket (
@@ -298,8 +298,15 @@ fn test_tcp_function_blk() {
298298 let name = unsafe { CStr :: from_ptr ( tfs. function_set_name . as_ptr ( ) ) } ;
299299 assert ! ( !name. to_bytes( ) . is_empty( ) ) ;
300300
301+ let aliastfs = getsockopt ( & fd, sockopt:: TcpFunctionAlias ) . unwrap ( ) ;
302+ let aliasname =
303+ unsafe { CStr :: from_ptr ( aliastfs. function_set_name . as_ptr ( ) ) } ;
304+ // freebsd default tcp stack has no alias.
305+ assert ! ( aliasname. to_bytes( ) . is_empty( ) ) ;
306+
301307 // We can't know at compile time what options are available. So just test the setter by a
302308 // no-op set.
309+ // TODO: test if we cn load for example BBR tcp stack kernel module.
303310 setsockopt ( & fd, sockopt:: TcpFunctionBlk , & tfs) . unwrap ( ) ;
304311}
305312
You can’t perform that action at this time.
0 commit comments