@@ -1165,8 +1165,8 @@ impl Socket {
11651165 ///
11661166 /// [`SOCK_RAW`]: Type::RAW
11671167 /// [raw(7)]: https://man7.org/linux/man-pages/man7/raw.7.html
1168- /// [`IP_TOS`]: Socket::set_tos
11691168 /// [`IP_TTL`]: Socket::set_ttl_v4
1169+ /// [`IP_TOS`]: Socket::set_tos_v4
11701170 #[ cfg_attr(
11711171 any( target_os = "fuchsia" , target_os = "illumos" , target_os = "solaris" ) ,
11721172 allow( rustdoc:: broken_intra_doc_links)
@@ -1562,26 +1562,26 @@ impl Socket {
15621562 target_os = "illumos" ,
15631563 target_os = "haiku" ,
15641564 ) ) ) ]
1565- pub fn set_tos ( & self , tos : u32 ) -> io:: Result < ( ) > {
1565+ pub fn set_tos_v4 ( & self , tos : u32 ) -> io:: Result < ( ) > {
15661566 unsafe { setsockopt ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_TOS , tos as c_int ) }
15671567 }
15681568
15691569 /// Get the value of the `IP_TOS` option for this socket.
15701570 ///
1571- /// For more information about this option, see [`set_tos `].
1571+ /// For more information about this option, see [`set_tos_v4 `].
15721572 ///
15731573 /// NOTE: <https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options>
15741574 /// documents that not all versions of windows support `IP_TOS`.
15751575 ///
1576- /// [`set_tos `]: Socket::set_tos
1576+ /// [`set_tos_v4 `]: Socket::set_tos_v4
15771577 #[ cfg( not( any(
15781578 target_os = "fuchsia" ,
15791579 target_os = "redox" ,
15801580 target_os = "solaris" ,
15811581 target_os = "illumos" ,
15821582 target_os = "haiku" ,
15831583 ) ) ) ]
1584- pub fn tos ( & self ) -> io:: Result < u32 > {
1584+ pub fn tos_v4 ( & self ) -> io:: Result < u32 > {
15851585 unsafe {
15861586 getsockopt :: < c_int > ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_TOS ) . map ( |tos| tos as u32 )
15871587 }
0 commit comments